-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (60 loc) · 1.88 KB
/
release-npm-package.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
name: Build & Publish Testerloop CLI NPM Package
permissions: write-all
on:
workflow_dispatch:
push:
tags:
- '*'
env:
NEW_VERSION: ${{ github.ref_name }}
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- name: Run linter
run: npm run lint
publish-npm:
needs: tests
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v3
# - name: Build Changelog
# id: github_release
# uses: mikepenz/release-changelog-builder-action@v3
# env:
# GITHUB_TOKEN: ${{ secrets.TESTERLOOP_ACCESS_TOKEN }}
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.TESTERLOOP_ACCESS_TOKEN }}
# with:
# tag_name: ${{ env.NEW_VERSION }}
# release_name: ${{ env.NEW_VERSION }}
# body: ${{ steps.github_release.outputs.changelog }}
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm run build
- name: Login to GitHub Package Registry
run: echo "//npm.pkg.github.com/:_authToken=${{secrets.secrets.NPM_TOKEN}}" >> ~/.npmrc
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: |
Build & Publish Testerloop CLI Package workflow completed.
Latest Release: *[ ${{ env.NEW_VERSION }} ]* (https://github.com/${{ github.repository }}/releases/${{ env.NEW_VERSION }})