Skip to content

Commit 39a0226

Browse files
Copilotcprecioso
andauthored
Add GitHub Action for automatic template release on tag creation (wasp-lang#511)
Co-authored-by: cprecioso <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Carlos Precioso <[email protected]> Co-authored-by: Carlos Precioso <[email protected]>
1 parent cd86e5c commit 39a0226

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Template Release
3+
4+
'on':
5+
push:
6+
tags:
7+
- 'wasp-v*-template'
8+
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: 'Tag to release (e.g., wasp-v0.18-template)'
13+
required: true
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
22+
env:
23+
tag_name: ${{ inputs.tag || github.ref_name }}
24+
archive_name: template.tar.gz
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v5
29+
with:
30+
ref: ${{ env.tag_name}}
31+
32+
- name: Create template archive
33+
working-directory: template
34+
run: tar -czf "../$archive_name" .
35+
36+
- name: Create release if it doesn't exist
37+
run: |
38+
if ! gh release view "$tag_name"; then
39+
gh release create "$tag_name"
40+
fi
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Upload release asset
45+
run: gh release upload "$tag_name" "$archive_name" --clobber
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)