-
Notifications
You must be signed in to change notification settings - Fork 86
77 lines (67 loc) · 2.65 KB
/
release-artifacts.yml
File metadata and controls
77 lines (67 loc) · 2.65 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
name: Release Artifacts
on:
push:
tags:
# Trigger on any tag push (including pre-releases - create-rwsdk will by default not choose pre-releases)
- "v*.*.*"
workflow_dispatch:
inputs:
version:
description: "Version name (optional, used for filenames)"
required: false
default: ""
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24.14.0
cache: "pnpm"
- name: Get tag or input version
id: vars
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Update starter package.json
run: |
version_without_v="${{ steps.vars.outputs.version }}"
(cd starter && npm pkg set dependencies.rwsdk=${version_without_v#v})
pnpm install --ignore-scripts --no-frozen-lockfile
- name: Update addon package.json files
run: |
version_without_v="${{ steps.vars.outputs.version }}"
for dir in ./addons/*/ ; do
if [ -f "${dir}package.json" ]; then
echo "Updating package.json in ${dir}"
(cd "$dir" && npm pkg set dependencies.rwsdk=${version_without_v#v})
fi
done
- name: Package starter and addon folders
run: |
mkdir -p output
# Package starter
tar -czvf output/starter-${{ steps.vars.outputs.version }}.tar.gz --exclude-vcs-ignores -C starter .
git ls-files starter | zip output/starter-${{ steps.vars.outputs.version }}.zip -@
# Package addons
for dir in ./addons/*/ ; do
folder_name=$(basename "$dir")
tar -czvf output/${folder_name}-${{ steps.vars.outputs.version }}.tar.gz --exclude-vcs-ignores -C "$dir" .
git ls-files "$dir" | zip output/${folder_name}-${{ steps.vars.outputs.version }}.zip -@
done
- name: Upload packaged artifacts to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: output/*
tag_name: ${{ steps.vars.outputs.version }}
prerelease: ${{ contains(steps.vars.outputs.version, '-') && !contains(steps.vars.outputs.version, '-beta.') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}