Skip to content

Commit

Permalink
Require bootstrap and tag before building distributions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekitdev committed May 30, 2024
1 parent 6c20d35 commit 64f2f27
Showing 1 changed file with 63 additions and 57 deletions.
120 changes: 63 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,6 +93,7 @@ jobs:

build-macos:
runs-on: macos-latest
needs: tag

strategy:
matrix:
Expand Down Expand Up @@ -75,6 +133,7 @@ jobs:
build-windows:
runs-on: windows-latest
needs: tag

strategy:
matrix:
Expand Down Expand Up @@ -116,6 +175,7 @@ jobs:
build-linux:
runs-on: ubuntu-latest
needs: tag

strategy:
matrix:
Expand Down Expand Up @@ -156,6 +216,7 @@ jobs:
build-linux-cross:
runs-on: ubuntu-latest
needs: tag

strategy:
matrix:
Expand Down Expand Up @@ -199,6 +260,7 @@ jobs:
build-musl:
runs-on: ubuntu-latest
needs: tag

strategy:
matrix:
Expand Down Expand Up @@ -239,6 +301,7 @@ jobs:
build-musl-cross:
runs-on: ubuntu-latest
needs: tag

strategy:
matrix:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 64f2f27

Please sign in to comment.