From 64f2f27e0517b6c79b43e8b47c3d0e7789796587 Mon Sep 17 00:00:00 2001 From: Nikita Tikhonov Date: Thu, 30 May 2024 17:23:58 +0300 Subject: [PATCH] Require `bootstrap` and `tag` before building distributions. --- .github/workflows/release.yml | 120 ++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 57 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49e52f2..a5a6a51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,8 +15,65 @@ env: changelog: CHANGELOG-${{ inputs.version }}.md jobs: + bootstrap: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build changelog ${{ inputs.version }} + run: cargo run preview > ${{ env.changelog }} + + - name: Upload changelog ${{ inputs.version }} + uses: actions/upload-artifact@v4 + with: + name: changelog + path: ${{ env.changelog }} + + - name: Build changelog + run: cargo run build --stage --remove + + - name: Setup bot user + run: | + git config --local user.name ${{ env.bot-name }} + git config --local user.email ${{ env.bot-email }} + + - name: Commit and push + run: | + git commit -m "Add ${{ inputs.version }} to the changelog." + git push + + tag: + runs-on: ubuntu-latest + needs: bootstrap + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup bot user + run: | + git config --local user.name ${{ env.bot-name }} + git config --local user.email ${{ env.bot-email }} + + - name: Tag and push + run: | + git tag v${{ inputs.version }} + git push --tags + build-source: runs-on: ubuntu-latest + needs: tag steps: - name: Checkout @@ -36,6 +93,7 @@ jobs: build-macos: runs-on: macos-latest + needs: tag strategy: matrix: @@ -75,6 +133,7 @@ jobs: build-windows: runs-on: windows-latest + needs: tag strategy: matrix: @@ -116,6 +175,7 @@ jobs: build-linux: runs-on: ubuntu-latest + needs: tag strategy: matrix: @@ -156,6 +216,7 @@ jobs: build-linux-cross: runs-on: ubuntu-latest + needs: tag strategy: matrix: @@ -199,6 +260,7 @@ jobs: build-musl: runs-on: ubuntu-latest + needs: tag strategy: matrix: @@ -239,6 +301,7 @@ jobs: build-musl-cross: runs-on: ubuntu-latest + needs: tag strategy: matrix: @@ -277,66 +340,9 @@ jobs: *.tar.gz *.sha256 - bootstrap: - runs-on: ubuntu-latest - - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Build changelog ${{ inputs.version }} - run: cargo run preview > ${{ env.changelog }} - - - name: Upload changelog ${{ inputs.version }} - uses: actions/upload-artifact@v4 - with: - name: changelog - path: ${{ env.changelog }} - - - name: Build changelog - run: cargo run build --stage --remove - - - name: Setup bot user - run: | - git config --local user.name ${{ env.bot-name }} - git config --local user.email ${{ env.bot-email }} - - - name: Commit and push - run: | - git commit -m "Add ${{ inputs.version }} to the changelog." - git push - - tag: - runs-on: ubuntu-latest - needs: bootstrap - - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bot user - run: | - git config --local user.name ${{ env.bot-name }} - git config --local user.email ${{ env.bot-email }} - - - name: Tag and push - run: | - git tag v${{ inputs.version }} - git push --tags - publish-python: runs-on: ubuntu-latest needs: - - tag - build-source - build-macos - build-windows