Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update major version tag on release #8

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
steps:
- uses: google-github-actions/release-please-action@v4
with:
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
target-branch: ${{ github.ref_name }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
release:
types: [released]

jobs:
update_major_tag:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
fetch-depth: 0

- name: Extract major from version
id: major
run: awk -F '.' '{print "major=" $1}' <<< '${{ github.event.release.tag_name }}' >> "$GITHUB_OUTPUT"

- name: Update major tag
run: git tag --force "${{ steps.major.outputs.major }}" "${{ github.event.release.tag_name }}"

- name: Push updated major tag
run: git push --force origin "${{ steps.major.outputs.major }}"