forked from snowplow/snowplow-javascript-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (78 loc) · 3.14 KB
/
Copy pathpublish.yml
File metadata and controls
96 lines (78 loc) · 3.14 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy Tracker
on:
workflow_dispatch:
inputs:
version:
description: 'The release tag'
required: true
jobs:
deploy:
runs-on: ubuntu-20.04
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: pnpm cache
uses: actions/cache@v2
with:
path: ./common/temp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Setup git
uses: oleksiyrudenko/gha-git-credentials@v2.1
with:
token: '${{ secrets.GITHUB_TOKEN }}'
name: github-actions[bot]
email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Rush Version
run: node common/scripts/install-run-rush.js version --bump --target-branch master --ignore-git-hooks
- name: Get version
id: version
run: echo "##[set-output name=TRACKER_VERSION;]$(node -p "require('./trackers/javascript-tracker/package.json').version")"
- name: Fail if version mismatch
if: ${{ github.event.inputs.version != steps.version.outputs.TRACKER_VERSION }}
run: |
echo "Input version (${{ github.event.inputs.version }}) doesn't match version in project (${{ steps.version.outputs.TRACKER_VERSION }})"
exit 1
- name: Rush Build
run: node common/scripts/install-run-rush.js rebuild --verbose
- name: Rush Test
run: node common/scripts/install-run-rush.js test --verbose
- name: Rush Publish
run: node common/scripts/install-run-rush.js publish --apply --include-all --publish --target-branch master --set-access-level public --ignore-git-hooks
- name: Generate Release Information
id: tag_version
uses: mathieudutour/github-tag-action@v5.4
with:
dry_run: true
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ''
default_bump: false
custom_tag: ${{ github.event.inputs.version }}
- name: Tag release
run: |
git tag -a ${{ steps.tag_version.outputs.new_tag }} -m "Version ${{ steps.tag_version.outputs.new_tag }}"
git push --tags
- name: Zip plugins
run: zip -r plugins.umd.zip ./plugins/*/dist/*.umd*.js*
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
name: Version ${{ steps.tag_version.outputs.new_tag }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
files: |
./trackers/javascript-tracker/dist/sp.js
./trackers/javascript-tracker/dist/sp.js.map
./trackers/javascript-tracker/dist/sp.lite.js
./trackers/javascript-tracker/dist/sp.lite.js.map
./plugins.umd.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}