-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.04 KB
/
release.yaml
File metadata and controls
38 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: read
jobs:
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release
id: create_release
uses: rymndhng/release-on-push-action@v0.28.0
with:
bump_version_scheme: patch
- name: Update major version tag
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%s)
SANITIZED_COMMIT_MESSAGE=$(echo "$COMMIT_MESSAGE" | tr -d '\n' | sed 's/[&|;`$(){}<>^"]/\\&/g')
echo "New release version ${{ steps.create_release.outputs.version }}"
VERSION=${{ steps.create_release.outputs.version }}
MAJOR=${VERSION%%.*}
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git tag -fa "${MAJOR}" -m "${COMMIT_MESSAGE}"
git push origin "${MAJOR}" --force