-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (43 loc) · 1.44 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
name: Release
on:
push:
branches:
- master
jobs:
release:
if: "!contains(github.event.head_commit.message, 'chore: release')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
branch: master
persist-credentials: false
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Setup Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "map3-release-bot"
- name: Build
run: |
yarn install
yarn build
- name: Check for uncommitted changes
id: get_changes
run: echo "::set-output name=changed::$(git status --porcelain | wc -l)"
- name: Commit and push files
if: steps.get_changes.outputs.changed != 0
run: |
git commit -a -m "chore: release 🚀"
git push https://${{ secrets.BOT_ACCESS_TOKEN }}@github.com/map3xyz/supercharge HEAD:master --follow-tags
- name: Release
if: steps.get_changes.outputs.changed != 0
env:
GITHUB_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }}
run: npx semantic-release
- name: Purge CDN jsDelivr cache
if: steps.get_changes.outputs.changed != 0
uses: gacts/purge-jsdelivr-cache@v1
with:
url: |
https://cdn.jsdelivr.net/gh/map3xyz/supercharge@1/dist/global/index.js
https://cdn.jsdelivr.net/gh/map3xyz/supercharge@1/dist/index.css