-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (84 loc) · 2.37 KB
/
build_publish.yaml
File metadata and controls
91 lines (84 loc) · 2.37 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
name: CoderBot Frontend Build and Publish as Release
on:
push:
tags:
- t*.** # disabled for now
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: ${{ contains( github.ref_name, 'rc') }}
prerelease: false
- name: Create artifact files
run: |
mkdir info
echo "${{ steps.create_release.outputs.id }}" > info/release_id
echo "${{ steps.create_release.outputs.upload_url }}" > info/upload_url
- uses: actions/upload-artifact@v1
with:
name: info
path: info
build:
needs: [release]
strategy:
matrix:
node-version: [22.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- uses: actions/download-artifact@v4
with:
name: info
- name: Set upload_url
id: upload_info
run: |
upload_url=$(cat info/upload_url)
echo "::set-output name=upload_url::$upload_url"
- name: Create archive
run: tar czf frontend.tar.gz dist
- name: Upload Built Frontend
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload_info.outputs.upload_url }}
asset_path: frontend.tar.gz
asset_name: frontend.tar.gz
asset_content_type: application/gzip
metadata:
name: Publish Release
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: info
- name: Set publish_info
id: publish_info
run: |
release_id=$(cat info/release_id)
echo "::set-output name=release_id::$release_id"
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.publish_info.outputs.release_id }}