forked from will-stone/browserosaurus
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (83 loc) · 3.08 KB
/
build.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
75
76
77
78
79
80
81
82
83
84
name: 'Build'
on: [pull_request, push]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
asset-path: [./out/make/zip/win32/x64]
asset-filename: [Browseratops-win32-x64-]
optional: [false]
include:
- os: macos-10.15
optional: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.optional }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 16.14.x
cache: 'npm'
- name: Setup Environment POSIX
if: runner.os != 'Windows'
run:
node -e "console.log('PACKAGE_VERSION=' +
require('./package.json').version + '\nPACKAGE_NAME=' +
require('./package.json').name + '-' +
require('./package.json').version)" >> $GITHUB_ENV
- name: Setup Environment Windows
if: runner.os == 'Windows'
run:
node -e "console.log('PACKAGE_VERSION=' +
require('./package.json').version + '\nPACKAGE_NAME=' +
require('./package.json').name + '-' +
require('./package.json').version)" >> $env:GITHUB_ENV
- name: Verify versions
run:
node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{
github.ref }}') { console.log('::error' + 'Version Mismatch.
refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}');
throw Error('Version Mismatch. pgk' + '${{ env.PACKAGE_VERSION }}' + '
refs/tags/v' + '${{ github.ref }}')} "
- run: npm ci --audit false
- run: npm run lint
# - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- run: npm run typecheck
- run: npm run test
- run: npm run package
- run: npm run make
# - name: Generate Changelog
# id: changelog
# uses: mindsers/changelog-reader-action@v2
# with:
# version: ${{ env.PACKAGE_VERSION }}
# path: ./CHANGELOG.md
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ env.PACKAGE_VERSION }}
# body: ${{ steps.changelog.outputs.changes }}
draft: false
prerelease: true
- name: Upload GitHub release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path:
${{ matrix.asset-path }}/${{ matrix.asset-filename}}${{
env.PACKAGE_VERSION }}.zip
asset_name:
${{ matrix.asset-path }}/${{ matrix.asset-filename}}${{
env.PACKAGE_VERSION }}.zip
asset_content_type: application/zip