-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (59 loc) · 1.77 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
name: Deploy Latest Release
on:
release:
types: [published, unpublished]
branches:
- main
jobs:
set-commit-hash:
name: Store the hash of the commit
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.commit-hash.outputs.commit_hash }}
steps:
- id: commit-hash
uses: ottofeller/github-actions/latest-release-commit-hash@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
name: Lint the code
needs: set-commit-hash
runs-on: ubuntu-latest
strategy:
matrix:
version: [16, 18]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.set-commit-hash.outputs.commit_hash }}
- uses: ottofeller/github-actions/npm-run@main
with:
node-version: ${{ matrix.version }}
command: cd ../eslint-config-ofmt && npm ci && cd ../ofmt && npm run lint
directory: ./ofmt
publish-npm:
name: Publish the release to NPM
needs: [set-commit-hash, lint]
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.set-commit-hash.outputs.commit_hash }}
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Publish @ottofeller/ofmt
run: npm publish --access public
working-directory: ./ofmt
- name: Publish @ottofeller/eslint-config-ofmt
run: npm publish --access public
working-directory: ./eslint-config-ofmt
- name: Publish @ottofeller/prettier-config-ofmt
run: npm publish --access public
working-directory: ./prettier-config-ofmt