-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (76 loc) · 3.04 KB
/
release.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
name: Release
on:
push:
tags:
- "*"
env:
typst_paper: Typst-Paper-Template
CHANGELOG_FILENAME: CHANGELOG.md
jobs:
build:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Zip
id: zip
run: |
mkdir ${{ env.typst_paper }}
mkdir ${{ env.typst_paper }}/template
cp example.typ paper_template.typ typst.toml ${{ env.typst_paper }}
cp template/main.typ ${{ env.typst_paper }}/template
zip -r ${{ env.typst_paper }}.zip ./${{ env.typst_paper }}
ls
echo "tag_name=$(git tag --sort version:refname | tail -n 1)" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
VERSION: ${{ github.ref }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: ${{ env.CHANGELOG_FILENAME }}
draft: false
prerelease: false
- name: Upload zip file
id: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.typst_paper }}.zip
asset_name: ${{ env.typst_paper }}-${{ github.ref_name }}.zip
asset_content_type: application/zip
- name: Upload
id: upload-main
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./template/main.typ
asset_name: main.typ
asset_content_type: text/typst
- name: Upload
id: upload-example
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./example.typ
asset_name: example.typ
asset_content_type: text/typst
- name: Upload paper template
id: upload-template
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./paper_template.typ
asset_name: paper_template.typ
asset_content_type: text/typst