-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.33 KB
/
release.yml
File metadata and controls
77 lines (65 loc) · 2.33 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
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
name: Release
on:
workflow_dispatch:
inputs:
forceVersionType:
description: "Force specific versioning type"
default: "-"
type: choice
required: false
options:
- "-"
- "major"
- "minor"
- "patch"
jobs:
release:
name: Release Graphton
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Fetch Sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.yarnpkg.com"
- name: Setup registries
run: |
yarn config set --json npmRegistries '{ "//registry.yarnpkg.com": { "npmAuthToken": "'${{ secrets.NPM_TOKEN }}'" }, "//npm.pkg.github.com": { "npmAuthToken": "'${{ secrets.GITHUB_TOKEN }}'" } }'
- name: Setup git config
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Link yarn dependencies
run: yarn
- name: Get changelog for this release
run: yarn standard-version --dry-run | sed -n '/^---$/,/^---$/p' | sed '1d;$d' | tee RELEASE_CHANGELOG.md
- name: Set changelog, version and tag
env:
FORCE_VERSION_TYPE: ${{ github.event.inputs.forceVersionType }}
run: |
[[ "$FORCE_VERSION_TYPE" != "-" ]] && yarn standard-version --release-as $FORCE_VERSION_TYPE || yarn standard-version
- name: Grab new version for release
run: echo "RELEASE_VERSION=$(node -e "console.log(require('./package.json').version);")" >> $GITHUB_ENV
- name: Push changes
uses: ad-m/github-push-action@master
with:
tags: true
- name: Publish NPM
run: yarn npm publish --access public
- name: Setup to publish to GitHub Packages
run: yarn config set npmPublishRegistry 'https://npm.pkg.github.com'
- name: Publish GitHub
run: yarn npm publish
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v$RELEASE_VERSION \
--title "v$RELEASE_VERSION" \
--notes "$(cat RELEASE_CHANGELOG.md)"