-
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (32 loc) · 1020 Bytes
/
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
name: Release
on:
push:
tags:
- v*
jobs:
validate:
runs-on: ubuntu-latest
steps:
- run: '! [[ $GITHUB_REF =~ -release$ ]]'
- run: '! [[ ${GITHUB_REF:10} =~ ^v[0-9]+$ ]]'
release:
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v3
- run: yarn install && yarn build
- name: Push tag for released action
run: |
rm -rf node_modules
yarn install --production
git config --global user.email "marp-team@marp.app"
git config --global user.name "Marp team"
git add -f lib node_modules
git commit -m "${GITHUB_REF:10} release"
git tag "${GITHUB_REF:10}-release"
git push origin refs/tags/${GITHUB_REF:10}-release
if [[ ${GITHUB_REF:10} =~ ^(v[0-9]+)\.[^-]+$ ]]; then
git push origin :refs/tags/${BASH_REMATCH[1]}
git tag -f ${BASH_REMATCH[1]}
git push origin refs/tags/${BASH_REMATCH[1]}
fi