Merge pull request #77 from SUSTech-CRA/feat/update-dist #310
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- uses: actions/setup-python@v3 | |
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@v3 | |
with: | |
name: 'sustech-thesis-dev-build' | |
path: 'sustech-thesis-dev-build.zip' | |
- name: Upload Pre-release artifact | |
uses: actions/upload-artifact@v3 | |
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@v3 | |
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@v3 | |
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 |