-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (48 loc) · 1.64 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (48 loc) · 1.64 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
name: Release tarball
# Builds the frontend and attaches a prebuilt plugin archive to the GitHub
# release, so the plugin can be installed without a Node toolchain:
#
# tar -xzf redmine_gtt-vX.Y.Z.tar.gz -C path/to/redmine/plugins/
#
# The archive contains the tracked plugin files plus the built assets
# (everything except node_modules and other development-only files), under a
# top-level redmine_gtt/ directory.
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-and-attach:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 22
- name: Build assets
env:
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
run: |
corepack enable pnpm
pnpm install --frozen-lockfile
pnpm build
- name: Create plugin archive
run: |
TAG="${{ github.event.release.tag_name }}"
STAGING=$(mktemp -d)
mkdir "$STAGING/redmine_gtt"
# tracked files only (no node_modules, .git, caches)...
git archive HEAD | tar -x -C "$STAGING/redmine_gtt"
# ...plus the built assets, which are gitignored
cp -R assets "$STAGING/redmine_gtt/"
tar -czf "redmine_gtt-$TAG.tar.gz" -C "$STAGING" redmine_gtt
tar -tzf "redmine_gtt-$TAG.tar.gz" | head -20
- name: Attach to release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="${{ github.event.release.tag_name }}"
gh release upload "$TAG" "redmine_gtt-$TAG.tar.gz" --clobber