-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (77 loc) · 2.47 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
72
73
74
75
76
77
78
79
80
name: Release
on:
push:
branches:
- main
tags:
- '!*'
jobs:
pre-release:
name: pre-release
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip release') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Check code for leaks
uses: zricethezav/gitleaks-action@master
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check linting
run: npm run lint
- name: Check types
run: npm run typecheck
- name: Run tests and collect coverage
run: npm run coverage
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
flags: unittests
fail_ci_if_error: true
verbose: true
release:
name: release
runs-on: ubuntu-latest
needs: [ pre-release ]
if: "!contains(github.event.head_commit.message, 'skip release') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Import OSlash bot's GPG key for signing commits
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.OSLASH_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.OSLASH_BOT_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Kick off release
run: npm_config_yes=true npx semantic-release
env:
NPM_USERNAME: oslashbot
NPM_EMAIL: ${{ steps.import-gpg.outputs.email }}
NPM_TOKEN: ${{ secrets.OSLASH_BOT_NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.OSLASH_BOT_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OSLASH_BOT_GITHUB_TOKEN }}
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}