-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (46 loc) · 1.42 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
53
name: Release
on:
push:
branches:
- main
jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_PERSONAL_TOKEN }}
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install npm dependencies
run: npm install
- name: Build it
run: npm run-script build:prod
- name: Run tests
run: npm run test:withIts
- name: Update Badges
run: npm run badge-script
- name: Package
if: github.ref == 'refs/heads/main'
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GIT_PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Copy package json
if: github.ref == 'refs/heads/main'
working-directory: ./dist
run: |
git config --local user.email "martin@forsti.eu"
git config --local user.name "Martin Forstner"
git pull
mv -v package.json ..
git commit -am "Release script ran. Commit package.json [skip ci]" --allow-empty
- name: Push changes
if: github.ref == 'refs/heads/main'
uses: ad-m/github-push-action@master
with:
GITHUB_TOKEN: ${{ secrets.GIT_PERSONAL_TOKEN }}