81
.github/workflows/build-release.yaml
vendored
Normal file
81
.github/workflows/build-release.yaml
vendored
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
name: Build PDF & Release
|
||||||
|
run-name: Build PDF and Release ${{ github.ref_name }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**.md'
|
||||||
|
- '.gitea/workflows/**'
|
||||||
|
- 'md-pdf.ron'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Fonts
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y fonts-liberation
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Setup Rust cache
|
||||||
|
uses: swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Install Typst
|
||||||
|
run: |
|
||||||
|
mkdir -p /usr/local/bin
|
||||||
|
curl -L -o typst.tar.xz https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz
|
||||||
|
tar -xJf typst.tar.xz --strip-components=1 -C /usr/local/bin/ typst-x86_64-unknown-linux-musl/typst
|
||||||
|
typst --version
|
||||||
|
|
||||||
|
- name: Install Typst & md-pdf (Rust)
|
||||||
|
run: |
|
||||||
|
cargo install md-pdf
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.23'
|
||||||
|
|
||||||
|
- name: Install svu (Go)
|
||||||
|
run: go install github.com/caarlos0/svu@latest
|
||||||
|
|
||||||
|
- name: Build PDF
|
||||||
|
run: |
|
||||||
|
md-pdf README.md
|
||||||
|
mv README.pdf PIS.pdf
|
||||||
|
|
||||||
|
# Calculate version based on commit messages (fix, feat, breaking)
|
||||||
|
- name: Calculate Next Version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
NEW_TAG=$(svu next)
|
||||||
|
echo "tag=$NEW_TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "Next version : $NEW_TAG"
|
||||||
|
|
||||||
|
# Create release and upload PDF
|
||||||
|
# Note: softprops works very well on recent Gitea
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
if: ${{ steps.version.outputs.tag != '' }} # Safety check
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.version.outputs.tag }}
|
||||||
|
name: Release ${{ steps.version.outputs.tag }}
|
||||||
|
files: PIS.pdf
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
Reference in New Issue
Block a user