v1.7.5 #39
Workflow file for this run
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
name: Update release version. | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: release ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-pc-windows-gnu | |
archive: zip | |
- target: x86_64-unknown-linux-musl | |
archive: tar.gz tar.xz tar.zst | |
- target: x86_64-apple-darwin | |
archive: zip | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Compile and release | |
uses: rust-build/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
RUSTTARGET: ${{ matrix.target }} | |
ARCHIVE_TYPES: ${{ matrix.archive }} | |
EXTRA_FILES: "README.md LICENSE" | |
TOOLCHAIN_VERSION: 1.70.0 | |
update-version: | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
- name: Sync release version. | |
uses: tj-actions/sync-release-version@v13 | |
id: sync-release-version | |
with: | |
pattern: '${{ github.repository }}@' | |
only_major: true | |
paths: | | |
README.md | |
- name: Sync release version for action.yml. | |
uses: tj-actions/sync-release-version@v13 | |
id: sync-release-version-action | |
with: | |
pattern: 'version: ' | |
paths: | | |
action.yml | |
- name: Run git-cliff | |
uses: tj-actions/git-cliff@v1 | |
- name: Bump version | |
uses: tj-actions/cargo-bump@v2 | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v16 | |
id: verify-changed-files | |
with: | |
files: | | |
action.yml | |
README.md | |
HISTORY.md | |
entrypoint.sh | |
Cargo.toml | |
- name: Commit changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git tag -d ${{ steps.branch-name.outputs.tag }} | |
git add ${{ steps.verify-changed-files.outputs.changed_files }} | |
git commit -m "chore: upgraded from ${{ steps.sync-release-version.outputs.old_version }} -> ${{ steps.sync-release-version.outputs.new_version }}" | |
git tag ${{ steps.branch-name.outputs.tag }} | |
git push -f origin ${{ steps.branch-name.outputs.tag }} | |
- name: Run release-tagger | |
uses: tj-actions/release-tagger@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: katyo/publish-crates@v2 | |
with: | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
base: "main" | |
labels: "merge when passing" | |
title: "chore: upgraded to ${{ steps.sync-release-version.outputs.new_version }}" | |
branch: "chore/upgrade-to-${{ steps.sync-release-version.outputs.new_version }}" | |
body: "View [CHANGES](https://github.com/${{ github.repository }}/compare/${{ steps.sync-release-version.outputs.old_version }}...${{ steps.sync-release-version.outputs.new_version }})" | |
token: ${{ secrets.PAT_TOKEN }} |