-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (42 loc) · 1.61 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
name: release
on:
workflow_run:
workflows:
- ci
branches:
- master
types:
- completed
jobs:
release:
# double check :)
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3.1.0
- name: Read node version from `.nvmrc` file
id: nvmrc
uses: browniebroke/read-nvmrc-action@v1
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvmrc.outputs.node_version }}
- name: Check if package.json version has been updated
id: package-version
uses: EndBug/version-check@v1
with:
file-url: https://unpkg.com/@goparrot/geocoder@latest/package.json
static-checking: localIsNew
- name: Create and push git tag, publish version to NPM and create github release
if: steps.package-version.outputs.changed == 'true'
run: |
echo "Version change found in commit ${{ steps.package-version.outputs.commit }}! New version: ${{ steps.package-version.outputs.version }} (${{ steps.package-version.outputs.type }})"
npm install --progress=false --loglevel=warn --ignore-scripts
git tag -f v${{ steps.package-version.outputs.version }} ${{ steps.package-version.outputs.commit }}
git push origin v${{ steps.package-version.outputs.version }}
npm run publish
npm run github-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}