Skip to content

Commit

Permalink
improve pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
ameknite committed Mar 13, 2024
1 parent 8d6c80e commit 25d84d6
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions .github/workflows/pre_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ name: Pre Release

on:
workflow_call:
inputs:
tag-version:
required: true
type: string
workflow_dispatch:
inputs:
bump-version:
description: "Add bump version: (e.g. -> v3.6.1)"
required: true
type: string

permissions:
contents: write
Expand Down Expand Up @@ -40,7 +49,41 @@ jobs:
- name: Run cargo msrv
run: cargo msrv verify

get-bump-version:
runs-on: ubuntu-latest
steps:
- run: |
tag="${{ inputs.tag-version || inputs.bump-version }}"
echo "bump=${tag##v}" >> $GITHUB_OUTPUT
id: version
outputs:
bump: ${{ steps.version.outputs.bump }}

bump-version:
needs: get-bump-version
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install cargo-bump
uses: taiki-e/install-action@v2
with:
tool: cargo-bump

- name: Run cargo bump
run: cargo bump ${{ needs.get-bump-version.outputs.bump }}

- name: Commit and Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Bump version: ${{ needs.get-bump-version.outputs.bump }}"

cargo-semver-checks:
needs: bump-version
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
Expand All @@ -51,8 +94,9 @@ jobs:

- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2

update-attribution:
needs: [get-bump-version, bump-version]
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
Expand All @@ -65,13 +109,16 @@ jobs:
uses: taiki-e/install-action@v2
with:
tool: cargo-attribution

- name: Git Pull
run: git pull

- name: Run cargo attribution
run: cargo attribution

- name: Commit and Push
uses: stefanzweifel/git-auto-commit-action@v5
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Weekly Update: Attributions"
commit_message: "[${{ needs.get-bump-version.outputs.bump }}]Update Attributions"


0 comments on commit 25d84d6

Please sign in to comment.