-
Notifications
You must be signed in to change notification settings - Fork 43
96 lines (79 loc) · 3.71 KB
/
main.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
88
89
90
91
92
93
94
95
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Get version
id: get_version
run: |
echo "::set-output name=version::$(grep -P -o '(?<=## \[).*(?=\])' -m1 CHANGELOG.md)"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
pip install -r riscof/requirements.txt
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Publish package
if: github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: ${{ secrets.PYPIUSERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPIPASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Tag
id: create_tag
if: github.ref == 'refs/heads/master'
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
custom_tag: ${{ steps.get_version.outputs.version }}
create_annotated_tag: True
tag_prefix: ''
- name: Create Release
id: create_release
if: github.ref == 'refs/heads/master'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
release_branch: refs/heads/master
release_name: ${{ steps.get_version.outputs.version }}
tag_name: ${{ steps.get_version.outputs.version }}
body: ${{ steps.extract-release-notes.outputs.release_notes }}
draft: false
prerelease: false
# - name: Script
# uses: ammaraskar/sphinx-action@master
# with:
# docs-folder: "docs/"
# pre-build-command: " apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended"
# build-command: " make latexpdf "
# - name: Upload Release Asset
# id: upload-release-asset
# if: github.ref == 'refs/heads/master'
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./docs/build/latex/riscv_config.pdf
# asset_name: riscv_config.pdf
# asset_content_type: application/pdf