-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (66 loc) · 1.95 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
name: Release
on:
workflow_dispatch:
inputs:
extension:
type: choice
options:
- 'back-up-firestore-to-storage'
- 'trigger-github-issues-from-crashlytics'
required: true
description: 'The name of the extension'
version:
type: string
required: true
description: 'The version of the extension'
commit:
type: string
required: false
description: 'Target the commit id (Defaults to HEAD)'
env:
TARGET: ${{ github.event.inputs.extension }}
VERSION_NUMBER: ${{ github.event.inputs.version }}
TAG_NAME: ${{ github.event.inputs.extension }}/v${{ github.event.inputs.version }}
jobs:
push-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit }}
- name: Push tag
run: |
git tag ${{ env.TAG_NAME }}
git push origin ${{ env.TAG_NAME }}
create-draft-release:
needs: push-tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract the specific version CHANGELOG
id: changelog
# GITHUB_OUTPUTやGITHUB_ENVでは改行が扱えないので、一旦ファイルに書き出す
run: |
mkdir -p /tmp
($echo ./.github/script/extract_specific_changelog.sh \
--target=${{ env.TARGET }} \
--version=${{ env.VERSION_NUMBER }}) \
> /tmp/body.md
- name: Show CHANGELOG
run: |
cat /tmp/body.md
# ref. https://github.com/ncipollo/release-action
- name: Create draft release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG_NAME }}
bodyFile: /tmp/body.md
generateReleaseNotes: true
draft: true
prerelease: false