forked from planetarium/NineChronicles
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.83 KB
/
release.yaml
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
name: release
on:
push:
tags:
- v*
branches:
- rc-v*
jobs:
release:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check if a new tag refers a merge commit
run: |
set -evx
curl -o /tmp/web-flow.gpg "$WEB_FLOW_KEY_URL"
gpg --import /tmp/web-flow.gpg
if ! git verify-commit "$GITHUB_REF_NAME" && \
[[ "$( git cat-file -p "$GITHUB_REF_NAME" \
| grep -Ei '^parent\s+[0-9a-f]{40}$' | wc -l )" -lt 2 ]]; then
echo "::error title=Invalid tag commit::Tags must refer to a merge" \
"commit or a commit signed by GitHub web-flow" \
"($WEB_FLOW_KEY_URL). The tag $GITHUB_REF_NAME refers to " \
"a commit $(git rev-parse $GITHUB_REF_NAME) which is neither" \
"a merge commit nor signed by GitHub web-flow."
exit 1
fi
env:
WEB_FLOW_KEY_URL: https://github.com/web-flow.gpg
- name: Update other repos referring NineChronicles as submodules
uses: planetarium/submodule-updater@main
with:
token: ${{ secrets.SUBMODULE_UPDATER_GH_TOKEN }}
committer: >
Submodule Updater <[email protected]>
targets: |
${{ github.repository_owner }}/9c-launcher:rc-${{ github.ref_name }}?
update-submodule:
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
steps:
- name: Update other repos referring NineChronicles as submodules
uses: planetarium/submodule-updater@main
with:
token: ${{ secrets.SUBMODULE_UPDATER_GH_TOKEN }}
committer: >
Submodule Updater <[email protected]>
targets: |
${{ github.repository_owner }}/9c-launcher:${{ github.ref_name }}