generated from Cray-HPE/metal-template
-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (71 loc) · 2.34 KB
/
promote-release.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
name: Promote build to a release (stable)
on:
push:
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
- 'v?[0-9]+.[0-9]+.[0-9]+.post[0-9]+'
workflow_dispatch:
env:
STREAM: stable
LATEST: false
jobs:
Promote:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Jfrog setup
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://artifactory.algol60.net
JF_USER: ${{ secrets.ARTIFACTORY_ALGOL60_USERNAME }}
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ALGOL60_TOKEN }}
- uses: ./.github/actions/prepare-artifacts
with:
STREAM: ${{ env.STREAM }}
- name: Get Branch
run: |
mapfile -t branches < <(git branch -r --contains ${{ github.ref }} | awk '{print $1}')
echo "${branches[@]}"
for branch in "${branches[@]}"; do
branch_name="${branch/origin\/}"
echo "${branch_name}"
if [ "${branch_name}" = 'main' ]; then
echo LATEST=true >> $GITHUB_ENV
break
fi
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true # if the job is re-ran to catch missed artifacts, allow updates
generateReleaseNotes: true
artifacts: ${{ env.DIR_UPLOAD }}/*
prerelease: false
makeLatest: ${{ fromJSON(env.LATEST) }}
generate_publish_docs:
name: generate docs with nox/sphinx and publish with mike
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Also fetch git-tags
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: nox
env:
GIT_REPO_NAME: "${GITHUB_REPOSITORY#*/}"
run: |
pip install .[ci,docs]
nox -e docs
- name: configure git user for bot commits
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: deploy docs with mike 🚀 and set as latest
run: |
mike deploy -F mkdocs.yml -b gh-pages --push --update-aliases ${{ github.ref_name}} latest
mike set-default -F mkdocs.yml -b gh-pages --push latest
- name: list doc versions 🚀
run: |
mike list -F mkdocs.yml -b gh-pages