Skip to content

Commit fae0a7a

Browse files
committed
ci: add auto-release.yml, remove release-pdf.yml, limit CI trigger to master
1 parent 9074524 commit fae0a7a

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PDF on Release
1+
name: Auto Release
22

33
on:
44
push:
@@ -10,12 +10,10 @@ permissions:
1010
contents: write
1111

1212
jobs:
13-
build-pdf:
14-
name: Generate PDF
13+
release:
1514
runs-on: ubuntu-latest
1615
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v6
16+
- uses: actions/checkout@v6
1917

2018
- name: Install Chromium and CJK fonts
2119
run: |
@@ -27,9 +25,9 @@ jobs:
2725
LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
2826
VERSION="${LATEST_TAG#v}"
2927
echo "Installing mdpress $VERSION"
30-
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o mdpress.tar.gz
31-
tar xzf mdpress.tar.gz
32-
sudo mv mdpress /usr/local/bin/
28+
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o /tmp/mdpress.tar.gz
29+
tar xzf /tmp/mdpress.tar.gz -C /tmp mdpress
30+
sudo mv /tmp/mdpress /usr/local/bin/
3331
mdpress --version
3432
3533
- name: Extract tag name
@@ -39,7 +37,7 @@ jobs:
3937
- name: Build PDF
4038
run: mdpress build --format pdf --output docker_practice-${{ steps.tag.outputs.TAG_NAME || 'latest' }}.pdf
4139

42-
- name: Create Release and upload PDF
40+
- name: Create Release with PDF
4341
if: startsWith(github.ref, 'refs/tags/')
4442
uses: softprops/action-gh-release@v2
4543
with:

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- master
57
pull_request:
68
workflow_dispatch:
79

0 commit comments

Comments
 (0)