-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.84 KB
/
publish.yaml
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
name: Publish
on:
pull_request:
branches:
- main
types: [closed]
jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.head_ref, 'release/v') && github.event.pull_request.merged == true
env:
REPO: https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Initialize
shell: bash
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Get tag name
id: vars
run: |
HEAD_REF=${{ github.head_ref }}
echo "tag=${HEAD_REF##*/v}" >> $GITHUB_OUTPUT
- name: setup rust
run: |
rustup update stable
cargo build --release
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.85.0'
extended: true
- name: Build Site
run: |
(cd docs ; hugo)
- name: Create Distributions
run:
make dist
- name: Create release
id: create_release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: v${{ steps.vars.outputs.tag }}
title: Release v${{ steps.vars.outputs.tag }}
draft: false
prerelease: false
files: |
dist/sibling-${{ steps.vars.outputs.tag }}_*.tar.gz