-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (70 loc) · 2.13 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
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
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: Release
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
release:
runs-on: ubuntu-latest
env:
CI: "true"
RELEASE: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Anti-tamper check
run: git diff --ignore-space-at-eol --exit-code
- name: Set git identity
run: |-
git config user.name "Automation"
git config user.email "[email protected]"
- name: Bump to next version
run: npx projen bump
- name: Build
run: npx projen build
- name: Check for new commits
id: git_remote
run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{
github.ref }} | cut -f1)"
- name: Create release
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }}
run: gh release create v$(node -p "require('./package.json').version") -F
.changelog.tmp.md -t v$(node -p "require('./package.json').version")
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Unbump
run: npx projen unbump
- name: Upload artifact
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }}
uses: actions/[email protected]
with:
name: dist
path: dist
- name: Anti-tamper check
run: git diff --ignore-space-at-eol --exit-code
container:
image: jsii/superchain
release_npm:
name: Release to NPM
needs: release
runs-on: ubuntu-latest
container:
image: jsii/superchain
steps:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Release
run: npx -p jsii-release@latest jsii-release-npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_DIST_TAG: latest
NPM_REGISTRY: registry.npmjs.org