-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (57 loc) · 1.94 KB
/
dev-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
64
65
66
67
68
69
70
name: Dev Release
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
dev-release:
permissions: write-all
name: Dev Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22.8.0'
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Prepare for pack
run: npm run prepack
- name: Build tarballs
run: npm run pack
- name: Clean up
run: npm run postpack
- name: Extract version
id: get_version
run: echo "::set-output name=VERSION::$(jq -r '.version' package.json)"
- name: Fetch commit info
id: get_git_info
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
git_branch=${GITHUB_REF#refs/heads/}
echo "::set-output name=GIT_HASH::$git_hash"
echo "::set-output name=GIT_BRANCH::$git_branch"
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: dev-${{ github.run_number }}
release_name: Dev Build on ${{ steps.get_git_info.outputs.GIT_BRANCH }} #${{ steps.get_git_info.outputs.GIT_HASH }}
draft: false
prerelease: true
- name: Upload release artifacts
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/*.gz
asset_name: hyp-v${{ steps.get_version.outputs.VERSION }}-${{ steps.get_git_info.outputs.GIT_HASH }}-${{ steps.get_git_info.outputs.GIT_BRANCH }}-win32-x64.tar.gz # Version, commit hash, and branch in the filename
asset_content_type: application/gzip