From b6d04e252f8f5bb99ac7a1601f42fed6c6ee61c0 Mon Sep 17 00:00:00 2001 From: Tobias Klug Date: Sat, 17 Aug 2024 15:11:49 +0200 Subject: [PATCH] Try to build a realease --- .../{main.yml => infrastructure.yml} | 0 .github/workflows/release.yml | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+) rename .github/workflows/{main.yml => infrastructure.yml} (100%) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/main.yml b/.github/workflows/infrastructure.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/infrastructure.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..705bf53 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + branches: + - 3-provide-local-db-for-storing-strikes + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + create-release: + name: Create release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + rust: stable + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + rust: stable + - target: x86_64-apple-darwin + os: macos-latest + rust: stable + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.rust }} + + - name: Get release version number + if: env.VERSION == '' + run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV + + - name: Check that tag version and Cargo.toml version are the same + shell: bash + run: | + if ! grep -q "version = \"$VERSION\"" Cargo.toml; then + echo "version does not match Cargo.toml" >&2 + exit 1 + fi + + - name: Create GitHub release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release create $VERSION --draft --verify-tag --title $VERSION + outputs: + version: ${{ env.VERSION }} + +