-
Notifications
You must be signed in to change notification settings - Fork 51
107 lines (92 loc) · 3.38 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
env: {}
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/action-release
# SOURCE: https://github.com/fregante/ghatemplates
name: Release
on:
push:
branches:
- "master"
tags:
- v*
jobs:
build_latex:
runs-on: ubuntu-latest
if: github.repository_owner == 'SUSTech-CRA'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
python-version: '3.9'
- name: Meta-data normalization
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: python test/update-dist.py --dev --sha ${GITHUB_SHA}
- name: run texlive docker container
uses: docker://texlive/texlive:latest
# https://hub.docker.com/r/texlive/texlive
with:
args: make dist-github
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
filename: 'sustech-thesis-dev-build.zip'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: 'sustech-thesis-dev-build'
path: 'sustech-thesis-dev-build.zip'
- name: Upload Pre-release artifact
uses: actions/upload-artifact@v4
with:
name: 'pre-release-artifacts_action_build'
path: |
sustechthesis.cls
sustechthesis.pdf
public-test/*.pdf
pre-release:
name: "Pre Release"
runs-on: "ubuntu-latest"
needs: build_latex
if: github.event_name == 'push'
steps:
- uses: actions/download-artifact@v4
name: Download artifact
- uses: "marvinpinto/action-automatic-releases@latest"
name: Auto pre-release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev-latest"
prerelease: true
title: "Dev Build(预发布)"
files: |
pre-release-artifacts_action_build/sustechthesis.cls
pre-release-artifacts_action_build/sustechthesis.pdf
pre-release-artifacts_action_build/public-test/*.pdf
sustech-thesis-dev-build/sustech-thesis-dev-build.zip
release-tag:
name: "Draft release by tag"
runs-on: "ubuntu-latest"
needs: build_latex
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
name: Download artifact
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Rename artifact
run: cp sustech-thesis-dev-build/sustech-thesis-dev-build.zip sustech-thesis-dev-build/sustech-thesis-${{ steps.get_version.outputs.VERSION }}.zip
- uses: "marvinpinto/action-automatic-releases@latest"
name: Upload release artifacts
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
automatic_release_tag: ${{ steps.get_version.outputs.VERSION }}
title: ${{ steps.get_version.outputs.VERSION }}
files: |
pre-release-artifacts_action_build/sustechthesis.cls
pre-release-artifacts_action_build/sustechthesis.pdf
pre-release-artifacts_action_build/public-test/*.pdf
sustech-thesis-dev-build/sustech-thesis-${{ steps.get_version.outputs.VERSION }}.zip