This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 209
87 lines (76 loc) · 2.67 KB
/
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
80
81
82
83
84
85
86
87
on:
push:
# Require one of the following patterns to match the tag
tags:
- 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+' # ex. v20.00.00.00
- 'v[0-9]+.[0-9]+.RC.[0-9]+' # ex. v20.00.RC.00
name: Create Release
env:
PROJECT_NAME: freedom-e-sdk
# Release is a prerelease if the tag contains rc
PRERELEASE: ${{ contains(github.ref, 'RC') }}
jobs:
release:
runs-on: ubuntu-latest
steps:
# Perform a recursive, PAT-authenticated checkout of all freedom-e-sdk
# submodules. This allows us to create and push tags to each submodule,
# triggering their own release workflow.
- name: 'Checkout'
uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 0
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# We tag submodules before creating the release notes or the release
# to make sure that they get tagged.
- name: 'Tag Submodules for Release'
run: |
tag=$(echo ${{ github.ref }} | cut -d '/' -f 3)
./scripts/tag-submodules.sh ${tag}
- name: 'Create Release Notes'
uses: sifive/action-release-notes@v1
id: create-release-notes
with:
project-name: ${{ env.PROJECT_NAME }}
release: ${{ github.ref }}
- name: 'Create Release'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.PROJECT_NAME }} ${{ github.ref }}
body: ${{ steps.create-release-notes.outputs.release-notes }}
draft: false
prerelease: ${{ env.PRERELEASE }}
- name: 'Clean Documentation Output Folder'
run: |
cd doc/html
git fetch
git checkout master
git reset --hard origin/master
rm -rf * .buildinfo .doctrees
- name: 'Login to Docker Hub'
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: 'Build Sphinx Documenattion'
run: |
tag=$(echo ${{ github.ref }} | cut -d '/' -f 3)
docker run \
--rm \
-v $(pwd)/doc:/docs \
-e RELEASE_TAG="${tag}" \
sphinxdoc/sphinx \
make html
- name: 'Publish Documentation'
run: |
tag=$(echo ${{ github.ref }} | cut -d '/' -f 3)
cd doc/html
git config user.email "[email protected]"
git config user.name "actions-bot"
git add .
git commit -m "Documentation for ${{ env.PROJECT_NAME }} ${tag}"
git push