diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54a7f4a..8be2023 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,3 +57,28 @@ jobs: examples/gta2/compile.cmd README.md LICENSE + + # A tag such as v1.0.0 publishes a GitHub Release with both binaries, once + # the builds and tests above have passed. Artifacts expire; releases don't. + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: [linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + - name: Package + run: | + cd dist + chmod +x cpp_permuter-linux-x64/build/cpp_permuter + for d in cpp_permuter-linux-x64 cpp_permuter-windows-x64; do + (cd "$d" && zip -qr "../$d-${GITHUB_REF_NAME}.zip" .) + done + ls -l + - uses: softprops/action-gh-release@v2 + with: + files: dist/*.zip + generate_release_notes: true diff --git a/README.md b/README.md index 2f98a55..342b524 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,13 @@ How it works: ## Getting it -Every CI run builds `cpp_permuter-linux-x64` and `cpp_permuter-windows-x64` (the Windows one -needs no Visual C++ redistributable). Download them from the run's artifacts on the -[Actions page](https://github.com/CriminalRETeam/cpp_permuter/actions/workflows/ci.yml), or build -from source: +Download a release from the [Releases page](https://github.com/CriminalRETeam/cpp_permuter/releases): +`cpp_permuter-linux-x64` and `cpp_permuter-windows-x64` (the Windows one needs no Visual C++ +redistributable). Pushing a tag such as `v1.0.0` publishes one, after the CI builds and +tests pass. Every CI run also keeps the binaries as artifacts for 90 days on the +[Actions page](https://github.com/CriminalRETeam/cpp_permuter/actions/workflows/ci.yml). + +Or build from source: ## Building