-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.09 KB
/
create-release.yaml
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
on:
push:
branches: ['main']
workflow_dispatch:
jobs:
createRelease:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set tag name
id: tag
run: |
if [[ "${{ github.event_name }}" != "push" ]]; then
tag=v$(date +%Y%m%d.%H%M%S)
else
tag=$(basename "${{ github.ref }}")
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Prepare release
id: prepare
run: |
tag="${{ steps.tag.outputs.tag }}"
zip_file="outputs/template-$tag.zip"
mkdir outputs
zip -r $zip_file rsc/ delft-hyperloop.cls main.tex
echo "zip_file=$zip_file" >> $GITHUB_OUTPUT
- name: Create release
run: |
tag="${{ steps.tag.outputs.tag }}"
body="Version at $(date +%Y%m%d.%H%M%S)"
zip_file="${{ steps.prepare.outputs.zip_file }}"
gh release create "$tag" --title "$tag" --notes "$body" "$zip_file#Template"
env:
GH_TOKEN: ${{ github.token }}