diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 12bac1d7c..746b4479c 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 @@ -28,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/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index b4f66a9ec..000000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: golangci-lint - -on: - push: - tags: - - v* - branches: - - main - pull_request: -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - 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 diff --git a/.github/workflows/help_wanted_notify.yml b/.github/workflows/help_wanted_notify.yml index c7b8a2ce1..321e2cc95 100644 --- a/.github/workflows/help_wanted_notify.yml +++ b/.github/workflows/help_wanted_notify.yml @@ -1,4 +1,4 @@ -name: notify social media (help wanted) +name: Notify Discord about "help wanted" issues on: issues: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..e75a71126 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: Lint + +on: + push: + tags: + - v* + branches: + - main + pull_request: +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v2.5.2 + with: + version: latest diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml new file mode 100644 index 000000000..be71cb1d3 --- /dev/null +++ b/.github/workflows/nightly_release.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: ./* diff --git a/.github/workflows/push_notify.yml b/.github/workflows/push_notify.yml index 29f8e1705..32ad0f3d7 100644 --- a/.github/workflows/push_notify.yml +++ b/.github/workflows/push_notify.yml @@ -1,4 +1,4 @@ -name: notify social media +name: Notify Discord on: release: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9efe9256b..398f1904d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,29 +1,29 @@ -name: goreleaser +name: Release on: push: tags: - - v*.*.* + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: - goreleaser: + build: runs-on: ubuntu-latest + permissions: + contents: write 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 }} + - uses: actions/checkout@v3 + - name: Get changelog + run: | + TAG=${{github.ref_name}} + VERSION=${TAG#v} + { + echo "RELEASE_BODY<> "$GITHUB_ENV" + - uses: ncipollo/release-action@v1 + with: + makeLatest: true + prerelease: true + body: ${{env.RELEASE_BODY}} diff --git a/.github/workflows/take.yml b/.github/workflows/take.yml index 84ec01568..ff40d1a49 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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 545db78d7..9e6b171b5 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: @@ -20,5 +22,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 diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index e75aeb9dc..000000000 --- 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/CHANGELOG.md b/CHANGELOG.md index 773e1262a..e1f8cc006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,5 +7,11 @@ 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 + +[0.30.0]: https://github.com/TimothyStiles/poly/releases/tag/v0.30.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5b378ab3c..881286ccc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,10 +112,42 @@ 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 Release + +> NOTE: Only contributors with write access to the repository can do this. + +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. 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 +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 new file mode 100644 index 000000000..07f8b5414 --- /dev/null +++ b/justfile @@ -0,0 +1,29 @@ +#!/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 ./... + +branch := `git branch --show-current` + +# Bump version in changelog and create commit + tag on current branch +cut-release $NEW_VERSION: + 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