generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (47 loc) · 1.76 KB
/
release.yml
File metadata and controls
52 lines (47 loc) · 1.76 KB
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 action
on:
push:
branches:
- master
jobs:
release-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Authenticate with GitHub package registry to be able to download from private repositories
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
- name: npm install
run: npm install
- name: release new version
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add -A
git diff-index --quiet HEAD || git commit -m "preparing release of new version"
npm version patch -m "Release new version: %s"
git push --tags
release-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: go to latest branch
run: git checkout -B latest
- name: merge with master
run: git merge origin/master --no-edit
- name: Authenticate with GitHub package registry to be able to download from private repositories
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
- name: npm install
run: npm install
- name: run build
run: npm run build
- name: add and push
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add -A
git diff-index --quiet HEAD || git commit -m "released new version"
git push --force https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY latest