-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (39 loc) · 1.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
name: Release
on:
push:
branches:
- main
- next
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Prepare repository
run: git fetch --unshallow --tags
- uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Create Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm ci
npm run ci:build
npx auto shipit
- name: Publish Action
run: |
RELEASE_NAME=releases/$(git describe --tags --abbrev=0 | cut -d- -f2 | cut -d. -f1)
npx action-docs -u
npm prune --production
git checkout --orphan $RELEASE_NAME
git rm -f --cached -r .
git add -f .github/workflows/tag_next.yml Dockerfile docker-compose.yml dist/index.js action.yml README.md CHANGELOG.md package-lock.json
git clean -fdx
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Release created from $GITHUB_SHA"
git push origin -f $RELEASE_NAME