-
-
Notifications
You must be signed in to change notification settings - Fork 177
83 lines (77 loc) · 2.53 KB
/
release.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Create offline documentation to release
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements.txt
- name: Run mkdocs --clean
run: |
mkdocs build --clean
- name: Upload pdf
uses: actions/upload-artifact@v4
with:
name: artifact
path: site/pdf/document.pdf
deploy:
needs: [ build ]
runs-on: ubuntu-20.04
env:
TZ: GMT
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: artifact
# - name: Add
# run: |
# ls -l
# git pull
# git add document.pdf
# - name: Commit files
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "Armbianworker"
# git commit --allow-empty -m "Update github actions" -a
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref }}
- name: Declare vars
id: vars
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "timenow=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Rename release artifact
shell: bash
run: |
mv -v document.pdf armbian-document-${{ steps.vars.outputs.sha_short }}.pdf
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.vars.outputs.sha_short }}
name: ${{ steps.vars.outputs.timenow }}-${{ steps.vars.outputs.sha_short }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: armbian-document-${{ steps.vars.outputs.sha_short }}.pdf
artifactContentType: application/pdf