-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (69 loc) · 2.33 KB
/
release.yml
File metadata and controls
74 lines (69 loc) · 2.33 KB
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
name: pre-release
on:
push:
tags: [ "[0-9]+.[0-9]+.[0-9]+*" ]
env:
GIT_CLIFF_VERSION: 2.12.0
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
- run: make docs
- if: ${{ github.ref_name != 'main' }}
name: Upload as artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # pin@v6.0.0
with:
name: docs
path: _build/
- if: ${{ github.ref_name == 'main' }}
name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build
force_orphan: true
create-pre-release:
if: ${{ github.ref_name == 'main' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout commit
uses: actions/checkout@v6
with:
sparse-checkout: |
cliff.toml
sparse-checkout-cone-mode: false
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
- name: Use cargo cache
id: cache-cargo
uses: actions/cache@v5
with:
path: |
~/.cargo
key: gh-release-${{ runner.os }}-git-cliff-${{ env.GIT_CLIFF_VERSION }}-
restore-keys: gh-release-${{ runner.os }}-git-cliff-${{ env.GIT_CLIFF_VERSION }}-${{ hashFiles('~/.cargo/.crates.toml') }}-
- name: Install git-cliff
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
cargo install git-cliff@${GIT_CLIFF_VERSION}
- name: Get the Git tag name
id: get-tag-name
run: echo "tag-name=${GITHUB_REF/refs\/tags\//}" | tee -a "$GITHUB_OUTPUT"
- id: release
name: Create changelog and release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gl-gh-release create \
--repo "python-gardenlinux-lib" \
--tag "${{ steps.get-tag-name.outputs.tag-name }}" \
--commit "${{ github.sha }}" \
--name 'python-gardenlinux-lib v${{ steps.get-tag-name.outputs.tag-name }}' \
--latest \
--body "
$(git-cliff -o - --current)
"