-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (62 loc) · 1.74 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
name: release
on:
release:
types: [published]
defaults:
run:
shell: bash -l {0}
env:
CACHE_NAME: node-modules-cache
jobs:
Create-NPM-Cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Upload to Cache
uses: actions/cache@v3.3.1
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }}
run: npm ci
Run-Tests:
permissions:
statuses: write
pull-requests: write
needs: [Create-NPM-Cache]
uses: ./.github/workflows/_test.yml
Release:
name: Release @skyscanner/eslint-config-skyscanner to NPM
runs-on: ubuntu-latest
environment: Publishing
needs: [Create-NPM-Cache, Run-Tests]
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Restore Cache
uses: actions/cache/restore@v3.3.1
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}
- name: Publish NPM package
run: |
npm version $RELEASE_VERSION --no-git-tag-version
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_VERSION: ${{ github.event.release.tag_name }}