Skip to content

Commit

Permalink
Update sync-release-version.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Mar 10, 2023
1 parent 1b4e73f commit b74c84f
Showing 1 changed file with 67 additions and 2 deletions.
69 changes: 67 additions & 2 deletions .github/workflows/sync-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,42 @@ on:


jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-go@v3
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 --rm-dist
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
- name: Run release-tagger
uses: tj-actions/release-tagger@v2

- name: Sync release version.
uses: tj-actions/sync-release-version@v13
id: sync-release-version
Expand All @@ -21,10 +49,47 @@ jobs:
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@v13
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@v2

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.2.3
with:
Expand Down

0 comments on commit b74c84f

Please sign in to comment.