From 045ea3973c22d30fc53c8efb4491477265355edd Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 13:02:34 -0500 Subject: [PATCH 01/19] Set up justfile --- .goreleaser.yml | 43 ------------------------------------------- justfile | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 43 deletions(-) delete mode 100644 .goreleaser.yml create mode 100644 justfile diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index e75aeb9d..00000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,43 +0,0 @@ -# This is an example goreleaser.yaml file with some sane defaults. -# Make sure to check the documentation at http://goreleaser.com -before: - hooks: - # You may remove this if you don't use go modules. - - go mod download - # you may remove this if you don't need go generate - - go generate ./... -builds: -- skip: true - -release: - # Repo in which the release will be created. - # Default is extracted from the origin remote URL or empty if its private hosted. - # Note: it can only be one: either github or gitlab or gitea - github: - owner: bebop - name: poly - - # IDs of the archives to use. - # Defaults to all. - # ids: - # - foo - # - bar - - # If set to true, will not auto-publish the release. - # Default is false. - draft: false - - # If set to auto, will mark the release as not ready for production - # in case there is an indicator for this in the tag e.g. v1.0.0-rc1 - # If set to true, will mark the release as not ready for production. - # Default is false. - prerelease: true - - # You can change the name of the GitHub release. - # Default is `{{.Tag}}` - name_template: "{{.ProjectName}}-v{{.Version}}" - - # You can disable this pipe in order to not upload any artifacts to - # GitHub. - # Defaults to false. - # disable: true \ No newline at end of file diff --git a/justfile b/justfile new file mode 100644 index 00000000..c795d428 --- /dev/null +++ b/justfile @@ -0,0 +1,14 @@ +#!/usr/bin/env just --justfile + +default: + @just --list + +coverage: + go test -v -coverprofile=provile.cov ./... + +lint: + golangci-lint -c .golangci.yml run + +test: + just lint + go test ./... \ No newline at end of file From a9796bae8f80aec6b97b3405e847d4a1584fd1d6 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 13:04:54 -0500 Subject: [PATCH 02/19] Make test job verbose --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index c795d428..34e4b2e8 100644 --- a/justfile +++ b/justfile @@ -11,4 +11,4 @@ lint: test: just lint - go test ./... \ No newline at end of file + go test -v ./... \ No newline at end of file From 8085ffcc352c739db009bf86235e9b4c03316d6b Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 13:11:52 -0500 Subject: [PATCH 03/19] Update test workflow --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 545db78d..f00112cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,5 +20,7 @@ jobs: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v2 - - name: Test - run: go test -v ./... + - name: Set up Just + uses: extractions/setup-just@v1 + - name: Run tests + run: just test From 27d5c837f3fb63dc5e51dbed581c04f5592244fe Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 13:14:22 -0500 Subject: [PATCH 04/19] more workflow fixes --- .github/workflows/golangci-lint.yml | 21 +-------------------- justfile | 1 - 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index b4f66a9e..673555d2 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,23 +16,4 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v2.5.2 with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: latest - - # Optional: working directory, useful for monorepos - # working-directory: somedir - - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true - - # Optional: if set to true then the action will use pre-installed Go. - # skip-go-installation: true - - # Optional: if set to true then the action don't cache or restore ~/go/pkg. - # skip-pkg-cache: true - - # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - # skip-build-cache: true + version: latest \ No newline at end of file diff --git a/justfile b/justfile index 34e4b2e8..d2d952f4 100644 --- a/justfile +++ b/justfile @@ -10,5 +10,4 @@ lint: golangci-lint -c .golangci.yml run test: - just lint go test -v ./... \ No newline at end of file From ea0eff06649621f4a712d4a1ca74f368dab38299 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 14:09:16 -0500 Subject: [PATCH 05/19] Big overhaul --- .github/workflows/coverage.yml | 4 ++- .../blocking_issues.yml | 0 .../{ => issue_management}/stale.yml | 0 .../workflows/{ => issue_management}/take.yml | 0 .../workflows/{golangci-lint.yml => lint.yml} | 0 .github/workflows/release.yml | 29 ------------------- .github/workflows/release/nightly.yml | 22 ++++++++++++++ .../{ => socials}/help_wanted_notify.yml | 0 .../workflows/{ => socials}/push_notify.yml | 0 .github/workflows/test.yml | 4 ++- 10 files changed, 28 insertions(+), 31 deletions(-) rename .github/workflows/{ => issue_management}/blocking_issues.yml (100%) rename .github/workflows/{ => issue_management}/stale.yml (100%) rename .github/workflows/{ => issue_management}/take.yml (100%) rename .github/workflows/{golangci-lint.yml => lint.yml} (100%) delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/release/nightly.yml rename .github/workflows/{ => socials}/help_wanted_notify.yml (100%) rename .github/workflows/{ => socials}/push_notify.yml (100%) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 12bac1d7..bb1d2a18 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -16,8 +16,10 @@ jobs: go-version: 1.21 - name: Checkout code uses: actions/checkout@v2 + - name: Set up Just + uses: extractions/setup-just@v1 - name: Generate coverage report - run: go test -v -coverprofile=profile.cov ./... + run: just coverage - name: Parse overall coverage run: coverage=$(go tool cover -func profile.cov | tail -1 | rev | cut -f 1 | rev) && echo "COVERAGE=$coverage" >> $GITHUB_ENV - name: Create the Badge diff --git a/.github/workflows/blocking_issues.yml b/.github/workflows/issue_management/blocking_issues.yml similarity index 100% rename from .github/workflows/blocking_issues.yml rename to .github/workflows/issue_management/blocking_issues.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/issue_management/stale.yml similarity index 100% rename from .github/workflows/stale.yml rename to .github/workflows/issue_management/stale.yml diff --git a/.github/workflows/take.yml b/.github/workflows/issue_management/take.yml similarity index 100% rename from .github/workflows/take.yml rename to .github/workflows/issue_management/take.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/lint.yml similarity index 100% rename from .github/workflows/golangci-lint.yml rename to .github/workflows/lint.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9efe9256..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: goreleaser - -on: - push: - tags: - - v*.*.* - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.21 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.HOMEBREW_DEPLOY_SECRET }} diff --git a/.github/workflows/release/nightly.yml b/.github/workflows/release/nightly.yml new file mode 100644 index 00000000..79e9c68a --- /dev/null +++ b/.github/workflows/release/nightly.yml @@ -0,0 +1,22 @@ +name: 'nightly release' + +on: + schedule: + - cron: '0 8 * * *' # Run at 0800 UTC (0300 EST) every day + +jobs: + mwe: + runs-on: ubuntu-latest + steps: + + # Clone repository + - uses: actions/checkout@v2 + + # Update tag and pre-release + # - Update (force-push) tag to the commit that is used in the workflow. + # - Upload artifacts defined by the user. + - uses: pyTooling/Actions/releaser@r0 + with: + tag: nightly + token: ${{ secrets.GITHUB_TOKEN }} + files: ./* \ No newline at end of file diff --git a/.github/workflows/help_wanted_notify.yml b/.github/workflows/socials/help_wanted_notify.yml similarity index 100% rename from .github/workflows/help_wanted_notify.yml rename to .github/workflows/socials/help_wanted_notify.yml diff --git a/.github/workflows/push_notify.yml b/.github/workflows/socials/push_notify.yml similarity index 100% rename from .github/workflows/push_notify.yml rename to .github/workflows/socials/push_notify.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f00112cf..93e48741 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,5 @@ +name: test + on: push: tags: @@ -5,7 +7,7 @@ on: branches: - main pull_request: -name: Test + jobs: test: strategy: From 71daf3d5ae8336917bb47d9df7bfe38c8957c6d0 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 14:10:27 -0500 Subject: [PATCH 06/19] Some renaming --- .github/workflows/lint.yml | 2 +- .github/workflows/socials/help_wanted_notify.yml | 2 +- .github/workflows/socials/push_notify.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 673555d2..a8f35f66 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: lint on: push: diff --git a/.github/workflows/socials/help_wanted_notify.yml b/.github/workflows/socials/help_wanted_notify.yml index c7b8a2ce..9fdcf140 100644 --- a/.github/workflows/socials/help_wanted_notify.yml +++ b/.github/workflows/socials/help_wanted_notify.yml @@ -1,4 +1,4 @@ -name: notify social media (help wanted) +name: notify discord (help wanted) on: issues: diff --git a/.github/workflows/socials/push_notify.yml b/.github/workflows/socials/push_notify.yml index 29f8e170..e8ec15e9 100644 --- a/.github/workflows/socials/push_notify.yml +++ b/.github/workflows/socials/push_notify.yml @@ -1,4 +1,4 @@ -name: notify social media +name: notify discord on: release: From 8a141864487776901bc333eed98ef6dbbe43e5fd Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 14:32:59 -0500 Subject: [PATCH 07/19] Reset CHANGELOG.md --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 773e1262..f833dcf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,5 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] + +## [0.30.0] - 2023-12-18 +Oops, we weren't keeping a changelog before this tag! + ### Fixed -- Fixed bug that produced wrong overhang in linear, non-directional, single cut reactions. #408 \ No newline at end of file +- Fixed bug that produced wrong overhang in linear, non-directional, single cut reactions. #408 + +[unreleased]: https://github.com/TimothyStiles/poly/compare/v0.30.0...main +[0.30.0]: https://github.com/TimothyStiles/poly/releases/tag/v0.30.0 + + From 784f07fe67e1ea29af82940afc2e3d47509bf740 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 19:18:05 -0500 Subject: [PATCH 08/19] Add just task to cut a release and bump changelog version --- justfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index d2d952f4..e8a676f9 100644 --- a/justfile +++ b/justfile @@ -10,4 +10,14 @@ lint: golangci-lint -c .golangci.yml run test: - go test -v ./... \ No newline at end of file + go test -v ./... + +RELEASE_CHANGELOG := `awk '/## \[Unreleased]/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md` + +cut-release $NEW_VERSION: + # Bump version in changelog and create tag for current branch + sed -i "s/## \[Unreleased]\s*\n*/## [Unreleased]\n\n## [$NEW_VERSION] $(date +'%Y-%m-%d')/g" CHANGELOG.md + echo "[$NEW_VERSION]: https://github.com/bebop/poly/releases/tag/v$NEW_VERSION" >> CHANGELOG.md + git add CHANGELOG.md + git commit -m "Release version v$NEW_VERSION" + git tag v$NEW_VERSION -m "## Changelog:\n{{RELEASE_CHANGELOG}}" From 5d77eafae89c56923f52f40de733d4d41f8d9a24 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 21:45:05 -0500 Subject: [PATCH 09/19] Beep --- CONTRIBUTING.md | 37 +++++++++++++++++++++++++++++++++++-- justfile | 14 +++++++++++--- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5b378ab3..cdefbc52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,10 +112,43 @@ For non-security bug reports please [submit it using this template!](https://git If you want to suggest a feature it's as easy as filling out this [issue template](https://github.com/bebop/poly/issues/new?assignees=&labels=&template=feature_request.md&title=), but before you do please [check to see if it's already been suggested!](https://github.com/bebop/poly/labels/enhancement) -# How add a recommended VSCode Plugin +## How to add a recommended VSCode Plugin Poly comes with a set of recommended plugins for VSCode. If you have suggestions that will simplify life for the poly dev community, consider doing a pull-request after modifying `.vscode/extensions.json`. +# Build and Release Pipelines + +## `just` Build System +We use [`just`](https://github.com/casey/just) as a task runner. See their README for install +instructions. To see the available recipes, execute `just list` in the root of the repository. + +## Normal Releases +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), which +looks like so: `vMAJOR.MINOR.PATCH`. We also keep a changelog in `CHANGELOG.md`. Major +versions indicate breaking changes to the API, minor versions indicate backwards-compatible +additions to the API, and patch versions indicate bugfixes. + +### Cutting a Major or Minor Release + +> NOTE: Only contributors with write access to the repository can do this. + +To cut a release, check out the `release` branch, merge any desired changes, +and then run `just cut-release ` (without the `v` before the version number). This +will perform the following actions locally: + +1. Lint and test the codebase +2. Update the changelog +3. Create a commit with the updated changelog +4. `git tag` the commit as `v` with a message containing a changelog + +Afterward, simply `git push` to upload the new commit and tag to the repository, and GitHub +Actions will automatically make a release! + +## Nightly Releases +`poly` features automatic nightly releases via GitHub Actions, located +[here](https://github.com/bebop/poly/releases/tag/nightly). These will reflect the status +of the `main` branch as of 0800UTC/0300EST. + # In closing -Thanks, for reading and I'm super psyched to see what you'll do with Poly! +Thanks for reading and I'm super psyched to see what you'll do with Poly! diff --git a/justfile b/justfile index e8a676f9..55265fd9 100644 --- a/justfile +++ b/justfile @@ -1,23 +1,31 @@ #!/usr/bin/env just --justfile +# List available recipes default: @just --list +# Get coverage profile coverage: go test -v -coverprofile=provile.cov ./... +# Linting and static checks lint: golangci-lint -c .golangci.yml run +# Run tests test: go test -v ./... -RELEASE_CHANGELOG := `awk '/## \[Unreleased]/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md` +branch := `git branch --show-current` +release_changelog := `awk '/## \[Unreleased]/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md` +# Bump version in changelog and create commit + tag on current branch cut-release $NEW_VERSION: - # Bump version in changelog and create tag for current branch + {{if branch != "release" {error("Releases can only be cut in the releases branch.")} else {""} }} + just lint + just test sed -i "s/## \[Unreleased]\s*\n*/## [Unreleased]\n\n## [$NEW_VERSION] $(date +'%Y-%m-%d')/g" CHANGELOG.md echo "[$NEW_VERSION]: https://github.com/bebop/poly/releases/tag/v$NEW_VERSION" >> CHANGELOG.md git add CHANGELOG.md git commit -m "Release version v$NEW_VERSION" - git tag v$NEW_VERSION -m "## Changelog:\n{{RELEASE_CHANGELOG}}" + git tag v$NEW_VERSION -m "## Changelog:\n{{release_changelog}}" From dcff21261c99efe8660f9c563f126e2afb45da2a Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:00:36 -0500 Subject: [PATCH 10/19] GitHub action to release on tag push --- .github/workflows/release/normal.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/release/normal.yml diff --git a/.github/workflows/release/normal.yml b/.github/workflows/release/normal.yml new file mode 100644 index 00000000..fce8cd1e --- /dev/null +++ b/.github/workflows/release/normal.yml @@ -0,0 +1,19 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - run: echo "RELEASE_BODY=${git tag -l --format='%(subject)' ${{ github.ref_name }}}" >> $GITHUB_ENV + - uses: ncipollo/release-action@v1 + with: + makeLatest: true + prerelease: true \ No newline at end of file From e7acc84ddd379481fd29906cd894ba65c246a607 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:07:20 -0500 Subject: [PATCH 11/19] Renaming stuff --- .github/workflows/{issue_management => }/blocking_issues.yml | 0 .github/workflows/{socials => }/help_wanted_notify.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/{release/nightly.yml => nightly_release.yml} | 2 +- .github/workflows/{socials => }/push_notify.yml | 2 +- .github/workflows/{release/normal.yml => release.yml} | 0 .github/workflows/{issue_management => }/stale.yml | 0 .github/workflows/{issue_management => }/take.yml | 0 .github/workflows/test.yml | 2 +- 9 files changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{issue_management => }/blocking_issues.yml (100%) rename .github/workflows/{socials => }/help_wanted_notify.yml (87%) rename .github/workflows/{release/nightly.yml => nightly_release.yml} (95%) rename .github/workflows/{socials => }/push_notify.yml (95%) rename .github/workflows/{release/normal.yml => release.yml} (100%) rename .github/workflows/{issue_management => }/stale.yml (100%) rename .github/workflows/{issue_management => }/take.yml (100%) diff --git a/.github/workflows/issue_management/blocking_issues.yml b/.github/workflows/blocking_issues.yml similarity index 100% rename from .github/workflows/issue_management/blocking_issues.yml rename to .github/workflows/blocking_issues.yml diff --git a/.github/workflows/socials/help_wanted_notify.yml b/.github/workflows/help_wanted_notify.yml similarity index 87% rename from .github/workflows/socials/help_wanted_notify.yml rename to .github/workflows/help_wanted_notify.yml index 9fdcf140..321e2cc9 100644 --- a/.github/workflows/socials/help_wanted_notify.yml +++ b/.github/workflows/help_wanted_notify.yml @@ -1,4 +1,4 @@ -name: notify discord (help wanted) +name: Notify Discord about "help wanted" issues on: issues: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a8f35f66..1ed83f23 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: lint +name: Lint on: push: diff --git a/.github/workflows/release/nightly.yml b/.github/workflows/nightly_release.yml similarity index 95% rename from .github/workflows/release/nightly.yml rename to .github/workflows/nightly_release.yml index 79e9c68a..e9c073ae 100644 --- a/.github/workflows/release/nightly.yml +++ b/.github/workflows/nightly_release.yml @@ -1,4 +1,4 @@ -name: 'nightly release' +name: Nightly Release on: schedule: diff --git a/.github/workflows/socials/push_notify.yml b/.github/workflows/push_notify.yml similarity index 95% rename from .github/workflows/socials/push_notify.yml rename to .github/workflows/push_notify.yml index e8ec15e9..32ad0f3d 100644 --- a/.github/workflows/socials/push_notify.yml +++ b/.github/workflows/push_notify.yml @@ -1,4 +1,4 @@ -name: notify discord +name: Notify Discord on: release: diff --git a/.github/workflows/release/normal.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release/normal.yml rename to .github/workflows/release.yml diff --git a/.github/workflows/issue_management/stale.yml b/.github/workflows/stale.yml similarity index 100% rename from .github/workflows/issue_management/stale.yml rename to .github/workflows/stale.yml diff --git a/.github/workflows/issue_management/take.yml b/.github/workflows/take.yml similarity index 100% rename from .github/workflows/issue_management/take.yml rename to .github/workflows/take.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93e48741..9e6b171b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: Test on: push: From c9857afd4b6ca07c5c6d4e5993680275ffbb8762 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:15:33 -0500 Subject: [PATCH 12/19] Small bugfix in release action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fce8cd1e..ebc85874 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: contents: write steps: - uses: actions/checkout@v3 - - run: echo "RELEASE_BODY=${git tag -l --format='%(subject)' ${{ github.ref_name }}}" >> $GITHUB_ENV + - run: echo "RELEASE_BODY=$(git tag -l --format='%(subject)' ${{ github.ref_name }})" >> $GITHUB_ENV - uses: ncipollo/release-action@v1 with: makeLatest: true From 2a621a930d4cb829d7c782ea0c2f238a773b3eb6 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:27:22 -0500 Subject: [PATCH 13/19] More fixes --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebc85874..98d4a2b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,10 @@ jobs: contents: write steps: - uses: actions/checkout@v3 - - run: echo "RELEASE_BODY=$(git tag -l --format='%(subject)' ${{ github.ref_name }})" >> $GITHUB_ENV + - name: Get changelog + run: | + TAG=${{github.ref_name}} + echo "RELEASE_BODY='$(awk '/## \[${TAG#v}]/{flag=1} /## \[/{flag=0} flag' CHANGELOG.md)'" >> $GITHUB_ENV - uses: ncipollo/release-action@v1 with: makeLatest: true From e013e3dd67e75b273984cbd7d4a2846e2c21dd12 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:29:54 -0500 Subject: [PATCH 14/19] More fixes yayyyy --- .github/workflows/release.yml | 3 ++- justfile | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98d4a2b0..6321c929 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,4 +19,5 @@ jobs: - uses: ncipollo/release-action@v1 with: makeLatest: true - prerelease: true \ No newline at end of file + prerelease: true + body: ${RELEASE_BODY} diff --git a/justfile b/justfile index 55265fd9..ed7c71e6 100644 --- a/justfile +++ b/justfile @@ -17,7 +17,6 @@ test: go test -v ./... branch := `git branch --show-current` -release_changelog := `awk '/## \[Unreleased]/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md` # Bump version in changelog and create commit + tag on current branch cut-release $NEW_VERSION: @@ -28,4 +27,4 @@ cut-release $NEW_VERSION: echo "[$NEW_VERSION]: https://github.com/bebop/poly/releases/tag/v$NEW_VERSION" >> CHANGELOG.md git add CHANGELOG.md git commit -m "Release version v$NEW_VERSION" - git tag v$NEW_VERSION -m "## Changelog:\n{{release_changelog}}" + git tag v$NEW_VERSION From e21b7eb389d7055bfdba47b9bed424be17428372 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:32:53 -0500 Subject: [PATCH 15/19] blargh --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6321c929..d42ef89c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,4 +20,4 @@ jobs: with: makeLatest: true prerelease: true - body: ${RELEASE_BODY} + body: ${{env.RELEASE_BODY}} From 5b0a6ae5e69db3153322f5182e448d9a8f4ab62e Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 22:53:03 -0500 Subject: [PATCH 16/19] More fixes! --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d42ef89c..fe4fedc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,8 @@ jobs: - name: Get changelog run: | TAG=${{github.ref_name}} - echo "RELEASE_BODY='$(awk '/## \[${TAG#v}]/{flag=1} /## \[/{flag=0} flag' CHANGELOG.md)'" >> $GITHUB_ENV + VERSION=${TAG#v} + echo "RELEASE_BODY='# [$VERSION] - $(date +%Y-%m-%d)\n$(awk '/## \['$VERSION']/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md)'" >> $GITHUB_ENV - uses: ncipollo/release-action@v1 with: makeLatest: true From 50b5b947c05e7c7e6fbe4368dbf0951159f688d2 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 23:09:54 -0500 Subject: [PATCH 17/19] Melting face emoji --- .github/workflows/release.yml | 7 ++++++- CHANGELOG.md | 3 --- CONTRIBUTING.md | 9 ++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe4fedc8..398f1904 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,12 @@ jobs: run: | TAG=${{github.ref_name}} VERSION=${TAG#v} - echo "RELEASE_BODY='# [$VERSION] - $(date +%Y-%m-%d)\n$(awk '/## \['$VERSION']/{flag=1; next} /## \[/{flag=0} flag' CHANGELOG.md)'" >> $GITHUB_ENV + { + echo "RELEASE_BODY<> "$GITHUB_ENV" - uses: ncipollo/release-action@v1 with: makeLatest: true diff --git a/CHANGELOG.md b/CHANGELOG.md index f833dcf3..e1f8cc00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,4 @@ Oops, we weren't keeping a changelog before this tag! ### Fixed - Fixed bug that produced wrong overhang in linear, non-directional, single cut reactions. #408 -[unreleased]: https://github.com/TimothyStiles/poly/compare/v0.30.0...main [0.30.0]: https://github.com/TimothyStiles/poly/releases/tag/v0.30.0 - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdefbc52..f4e824b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -137,12 +137,11 @@ and then run `just cut-release ` (without the `v` before the version nu will perform the following actions locally: 1. Lint and test the codebase -2. Update the changelog -3. Create a commit with the updated changelog -4. `git tag` the commit as `v` with a message containing a changelog +2. Update the changelog and commit it +3. `git tag` the commit as `v` -Afterward, simply `git push` to upload the new commit and tag to the repository, and GitHub -Actions will automatically make a release! +Afterward, simply run `git push` and `git push v` to upload the new commit +and tag to the repository, and GitHub Actions will automatically make a release! ## Nightly Releases `poly` features automatic nightly releases via GitHub Actions, located From f81ffeb0ca975df995436cc4fb0ffaa8203df90e Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Mon, 18 Dec 2023 23:11:44 -0500 Subject: [PATCH 18/19] Add newlines --- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/nightly_release.yml | 2 +- .github/workflows/take.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bb1d2a18..746b4479 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -30,4 +30,4 @@ jobs: filename: coverage.json label: Coverage message: ${{ env.COVERAGE }} - color: green \ No newline at end of file + color: green diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1ed83f23..e75a7112 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,4 +16,4 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v2.5.2 with: - version: latest \ No newline at end of file + version: latest diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml index e9c073ae..be71cb1d 100644 --- a/.github/workflows/nightly_release.yml +++ b/.github/workflows/nightly_release.yml @@ -19,4 +19,4 @@ jobs: with: tag: nightly token: ${{ secrets.GITHUB_TOKEN }} - files: ./* \ No newline at end of file + files: ./* diff --git a/.github/workflows/take.yml b/.github/workflows/take.yml index 84ec0156..ff40d1a4 100644 --- a/.github/workflows/take.yml +++ b/.github/workflows/take.yml @@ -15,4 +15,4 @@ jobs: with: message: Thanks for taking this issue! Let us know if you have any questions! trigger: .take - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} From 563b0d5cf0bcb0066670cfd3edbf9755a74799b1 Mon Sep 17 00:00:00 2001 From: Willow Carretero Chavez Date: Tue, 19 Dec 2023 00:29:47 -0500 Subject: [PATCH 19/19] Favor main branch over release branch for releases --- CONTRIBUTING.md | 6 +++--- justfile | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4e824b5..881286cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,16 +128,16 @@ looks like so: `vMAJOR.MINOR.PATCH`. We also keep a changelog in `CHANGELOG.md`. versions indicate breaking changes to the API, minor versions indicate backwards-compatible additions to the API, and patch versions indicate bugfixes. -### Cutting a Major or Minor Release +### Cutting a Release > NOTE: Only contributors with write access to the repository can do this. -To cut a release, check out the `release` branch, merge any desired changes, +To cut a release, check out the `main` branch, merge any desired changes, and then run `just cut-release ` (without the `v` before the version number). This will perform the following actions locally: 1. Lint and test the codebase -2. Update the changelog and commit it +2. Bump the version in the changelog and commit it 3. `git tag` the commit as `v` Afterward, simply run `git push` and `git push v` to upload the new commit diff --git a/justfile b/justfile index ed7c71e6..07f8b541 100644 --- a/justfile +++ b/justfile @@ -20,7 +20,6 @@ branch := `git branch --show-current` # Bump version in changelog and create commit + tag on current branch cut-release $NEW_VERSION: - {{if branch != "release" {error("Releases can only be cut in the releases branch.")} else {""} }} just lint just test sed -i "s/## \[Unreleased]\s*\n*/## [Unreleased]\n\n## [$NEW_VERSION] $(date +'%Y-%m-%d')/g" CHANGELOG.md