-
Notifications
You must be signed in to change notification settings - Fork 68
96 lines (79 loc) · 2.61 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Manual workflow to release new package version
name: Manual-Version-Release
on:
workflow_dispatch:
inputs:
changeLog:
description: "Change Log"
required: true
default: ""
releaseType:
type: choice
description: Select patch/minor/major
options:
- patch
- minor
- major
jobs:
publish:
runs-on: ubuntu-latest
steps:
- run: echo 'Starting the workflow'
- uses: oprypin/find-latest-tag@v1
id: get-latest-tag
with:
repository: unstoppabledomains/resolution # current repositiry
releases-only: false
- name: "Get next versions"
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.get-latest-tag.outputs.tag }}
- name: Set new tag
id: set-new-tag
run: |
if [[ ${{ github.event.inputs.releaseType }} == major ]]; then
echo "tag=${{ steps.semvers.outputs.v_major }}" >> $GITHUB_OUTPUT
elif [[ ${{ github.event.inputs.releaseType }} == minor ]]; then
echo "tag=${{ steps.semvers.outputs.v_minor }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ steps.semvers.outputs.v_patch }}" >> $GITHUB_OUTPUT
fi
- name: "Log inputs"
run: |
echo Release Version: ${{ steps.set-new-tag.outputs.tag }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
token: ${{ secrets.RELEASE_SECRET }}
- name: New package.json version
run: yarn version --new-version ${{ steps.set-new-tag.outputs.tag }} --no-git-tag-version
- name: "Create tag"
run: |
git tag ${{ steps.set-new-tag.outputs.tag }}
git push origin --tags
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
always-auth: true
registry-url: "https://registry.npmjs.org"
- run:
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}"
> ~/.npmrc
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: yarn publish
- name: Commit new version
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.release.target_commitish }}
commit_message: Release new version ${{ steps.set-new-tag.outputs.tag }}
- name: Deploy docs
run: yarn docs:deploy