-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (64 loc) · 2.23 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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
name: From changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get latest release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v3
with:
command: query
version: latest-or-unreleased
- name: Get latest release
id: latest-release
uses: actions/github-script@v7
if: steps.query-release-info.outputs.version != '[unreleased]'
continue-on-error: true
with:
script: |
return await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "v${{ steps.query-release-info.outputs.version }}"
})
- name: Create release
id: create-release
uses: actions/github-script@v7
if: steps.latest-release.outcome == 'failure'
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: "v${{ steps.query-release-info.outputs.version }}",
target_commitish: context.sha,
name: "v${{ steps.query-release-info.outputs.version }}",
body: `${{ steps.query-release-info.outputs.release-notes }}`
})
- name: Tag Submodules
uses: actions/github-script@v7
if: steps.create-release.outcome == 'success'
with:
script: |
const modules = [
'provider/file', 'provider/pflag',
'provider/appconfig', 'provider/s3', 'provider/parameterstore', 'notifier/sns',
'provider/azappconfig', 'provider/azblob', 'notifier/azservicebus',
'provider/secretmanager', 'provider/gcs', 'notifier/pubsub'
]
for (const module of modules) {
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/"+module+"/v${{ steps.query-release-info.outputs.version }}",
sha: context.sha
})
}