-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
name: release | ||
name: Release | ||
on: | ||
push: | ||
tags: "v*" | ||
tags: "v*.*.*" | ||
|
||
jobs: | ||
release: | ||
Release: | ||
name: Publish release note | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -15,12 +17,12 @@ jobs: | |
- name: Show Tag | ||
id: tag | ||
run: echo ::set-output name=TAG::${GITHUB_REF##*/} | ||
- name: Generate Changelog | ||
- name: Generate Release Changelog | ||
uses: orhun/git-cliff-action@v1 | ||
id: git-cliff | ||
with: | ||
config: .github/workflows/cliff.toml | ||
args: -v --strip all --current | ||
args: -v --strip all --latest | ||
env: | ||
OUTPUT: CHANGELOG.md | ||
- name: Create GitHub release | ||
|
@@ -29,3 +31,34 @@ jobs: | |
body_path: ${{ steps.git-cliff.outputs.changelog }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Update Changelog | ||
uses: orhun/git-cliff-action@v1 | ||
id: changelog | ||
with: | ||
config: .github/workflows/cliff.toml | ||
args: -v | ||
env: | ||
OUTPUT: CHANGELOG.md | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
- name: Bump Version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMMIT_MSG: | | ||
chore(release): ${{ steps.tag.outputs.TAG }} | ||
See: https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.TAG }} | ||
run: | | ||
version="${{ steps.tag.outputs.TAG }}" | ||
version="${version//v/}" | ||
sed -i'' "s/^version.*$/version = \"$version\"/g" Cargo.toml | ||
cargo update --workspace | ||
git add CHANGELOG.md Cargo.toml Cargo.lock | ||
git config --global user.name 'release[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
git commit -m "${COMMIT_MSG}" | ||
git push origin HEAD:master |