-
-
Notifications
You must be signed in to change notification settings - Fork 13
78 lines (70 loc) · 2.38 KB
/
release.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: release
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
types:
- labeled
jobs:
release:
if: ${{ github.event.action != 'labeled' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
packages: write
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 0
# Release tags must be reachable from HEAD because the bump comment uses `git tag --merged`:
# https://github.com/haya14busa/bump/blob/9ab5412f5d96eb624c7e8559acbb11330be9901a/main.go#L72
- name: checkout to release branch
run: |
git checkout -b "releases/$(cat .major-version)" "origin/releases/$(cat .major-version)"
# Bump version on merging Pull Requests with specific labels.
# (bump:major,bump:minor,bump:patch)
- id: bumpr
uses: haya14busa/action-bumpr@v1
with:
dry_run: true
# build the Docker Image
- name: build the Docker Image
if: "${{ !steps.bumpr.outputs.skip }}"
run: |
git checkout main
./.github/build.sh
env:
GITHUB_TOKEN: ${{ github.token }}
INPUT_TAG: ${{ steps.bumpr.outputs.next_version }}
# Create release.
- uses: shogo82148/actions-create-release@v1
if: "${{ !steps.bumpr.outputs.skip }}"
with:
tag_name: ${{ steps.bumpr.outputs.next_version }}
release_name: Release ${{ steps.bumpr.outputs.next_version }}
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false
release-check:
if: "${{ github.event.action == 'labeled' }}"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 0
# Release tags must be reachable from HEAD because the bump comment uses `git tag --merged`:
# https://github.com/haya14busa/bump/blob/9ab5412f5d96eb624c7e8559acbb11330be9901a/main.go#L72
- name: checkout to release branch
run: |
git checkout -b "releases/$(cat .major-version)" "origin/releases/$(cat .major-version)"
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1