Skip to content

v2.5.0

v2.5.0 #70

name: Update release version.
on:
release:
types: [published]
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
update-version:
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- 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: Generate CHANGELOG
uses: tj-actions/github-changelog-generator@v1.18
with:
output: 'HISTORY.md'
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v14
id: verify-changed-files
with:
files: |
README.md
HISTORY.md
action.yml
- 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@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.1
with:
base: "main"
labels: "merge when passing"
title: "Upgraded to ${{ steps.sync-release-version.outputs.new_version }}"
branch: "upgrade-to-${{ steps.sync-release-version.outputs.new_version }}"
commit-message: "Upgraded from ${{ steps.sync-release-version.outputs.old_version }} -> ${{ 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 }}