From 9c41e3deb92a3e626e09b56a31f04e6ba470ff0e Mon Sep 17 00:00:00 2001 From: Nico Wagner Date: Sun, 9 Feb 2025 20:12:07 +0100 Subject: [PATCH] Refactor release workflow Signed-off-by: Nico Wagner --- .github/workflows/release.yml | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..441723906 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: Release + +on: + pull_request: + paths: + - .github/workflows/*.yml + - Cargo.toml + - crates/** + - src/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_INCREMENTAL: 0 + CARGO_TERM_COLOR: always + RUSTDOCFLAGS: "-Dwarnings" + RUSTUP_MAX_RETRIES: 10 + RUST_BACKTRACE: 1 + VERSION: "v1.0.0" # FIXME + +permissions: + contents: write + +defaults: + run: + shell: bash + +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get release version + if: env.VERSION == '' + run: | + echo "RELEASE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV + echo "VERSION=${github.ref_name#v}" >> $GITHUB_ENV + - name: Show release version + run: | + echo "Release tag is $RELEASE_TAG" + echo "Release version is $VERSION" + - name: Create GitHub release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # FIXME: --verify-tag + run: gh release create $RELEASE_TAG--draft --generate-notes --title $RELEASE_TAG + + + release: + runs-on: ubuntu-latest + needs: + - prepare + steps: + - run: exit 0