-
Notifications
You must be signed in to change notification settings - Fork 17
88 lines (76 loc) · 2.67 KB
/
publish-release-artifacts.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
85
86
87
88
# Prepares the Release artifacts, creates a new GitHub Release, and publishes the artifacts to the Release
name: Release - Publish Artifacts
on:
workflow_dispatch:
inputs:
release-flavor:
description: "Beta release or stable release."
required: true
type: choice
options:
- stable
jobs:
publish:
runs-on: ubuntu-latest
name: Publish Release
permissions:
contents: write
id-token: write
steps:
- name: Use Node.js v20.17.x
uses: actions/setup-node@v4
with:
node-version: "20.17.x"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# Retrieve version to tag and publish release with
- name: Retrieve version from package.json
id: version
run: |
clientVer=$(jq -r .version client/package.json)
echo clientversion: $clientVer
serverVer=$(jq -r .version server/package.json)
echo serverversion: $serverVer
if [ $clientVer != $serverVer ]; then (echo "client and server versions do not match"; exit 1;); fi
echo "newProjectVersion=$clientVer" >> $GITHUB_OUTPUT
- name: Update packageUrl in ARM templates
run: node scripts/set-arm-package-url.js Release/${{ steps.version.outputs.newProjectVersion }}
# Create zipped version of the repository
- name: Create source archive
run: zip -r sample-source.zip . -x *.git*
# Install dependencies
- name: Install client dependencies
working-directory: ./client
run: npm install
- name: Install server dependencies
working-directory: ./server
run: npm install
# Create production package
- name: Package project
working-directory: ./client
run: npm run package
# Zip output files
- name: Zip distribution
working-directory: ./dist
run: zip -r sample.zip .
# Push git tags
- name: Create and push git tags
run: |
git tag ${{ steps.version.outputs.newProjectVersion }}
git push --tags
# Create a new Release and publish artifacts
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.version.outputs.newProjectVersion }}
tag_name: Release/${{ steps.version.outputs.newProjectVersion }}
files: |
./dist/sample.zip
./deploy/azuredeploy.json
./deploy/editableazuredeploy.json
./deploy/azuredeployexistingresource.json
./sample-source.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}