Skip to content

Commit 649c599

Browse files
committed
ci: release GHA (cairo-book#689)
1 parent f6530f1 commit 649c599

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and Release mdbook
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- v*
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Rust cache
22+
uses: ./.github/workflows/setup-rust-cache
23+
24+
- name: Install mdbook
25+
uses: ./.github/workflows/install-mdbook
26+
27+
- name: Build book (English)
28+
run: mdbook build -d book
29+
30+
- name: Create ZIP file
31+
run: zip -r markdown-output.zip book/markdown
32+
33+
- name: Create Release
34+
id: create_release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: ${{ github.ref }}
40+
release_name: Release ${{ github.ref }}
41+
draft: false
42+
prerelease: false
43+
44+
- name: Upload Release Asset
45+
uses: actions/upload-release-asset@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: ./markdown-output.zip
51+
asset_name: markdown-output.zip
52+
asset_content_type: application/zip

0 commit comments

Comments
 (0)