-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (33 loc) · 1.01 KB
/
Copy pathrelease.yml
File metadata and controls
38 lines (33 loc) · 1.01 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:
pull_request:
branches: [main]
types: [closed]
permissions:
contents: write
jobs:
compute-version:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compute next version
id: version
run: |
CURRENT=$(cat VERSION)
BASE=${CURRENT#v}
MAJOR=$(echo "$BASE" | cut -d. -f1)
MINOR=$(echo "$BASE" | cut -d. -f2)
MINOR=$((MINOR + 1))
NEXT="v${MAJOR}.${MINOR}.0"
echo "version=$NEXT" >> "$GITHUB_OUTPUT"
echo "Bumping $CURRENT -> $NEXT"
release:
needs: compute-version
uses: ./.github/workflows/build-and-release.yml
with:
version: ${{ needs.compute-version.outputs.version }}
commit-message: "Release ${{ needs.compute-version.outputs.version }}"