-
Notifications
You must be signed in to change notification settings - Fork 266
81 lines (73 loc) · 2.43 KB
/
force-build.yml
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
75
76
77
78
79
80
81
# this workflow is a workaround for docs-test job of ci-cd workflow failures
# as github rate limits the number of HTTP requests
# use only when you need to build the binaries/artifacts first making sure that other tests pass
name: force-build
on:
workflow_dispatch:
# make sure those env vars are aligned with the ones in ci-cd.yml workflow
env:
GO_VER: "1.22.6"
CGO_ENABLED: 0
MKDOCS_INS_VER: 9.5.9-insiders-4.52.2-hellt
GORELEASER_VER: v2.0.1
PY_VER: "3.10"
jobs:
get-tag:
runs-on: ubuntu-22.04
outputs:
git_tag: ${{ steps.git_tag.outputs.git_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get git tag
id: git_tag
run: |
echo "::set-output name=git_tag::$(git tag --points-at)"
echo ${{ steps.git_tag.outputs.git_tag }}
build-and-release:
needs: get-tag
if: ${{ needs.get-tag.outputs.git_tag != '' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVER }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: ${{ env.GORELEASER_VER }}
args: release --clean --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURYPUSHTOKEN }}
publish-docs:
needs: build-and-release
runs-on: ubuntu-22.04
if: contains(github.ref, '-') != true # do not publish docs for beta releases which will have something like v0.0.0-0.33.0-beta
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build docs
if: ${{ contains(needs.get-tag.outputs.git_tag, '-') != true }}
run: docker run -v $(pwd):/docs --entrypoint mkdocs ghcr.io/srl-labs/mkdocs-material-insiders:$MKDOCS_INS_VER gh-deploy --force --strict