-
Notifications
You must be signed in to change notification settings - Fork 103
152 lines (146 loc) · 4.59 KB
/
release.yml
File metadata and controls
152 lines (146 loc) · 4.59 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Release Build
on:
milestone:
types: [closed]
env:
PYTHON_VERSION: 3.9
POETRY_PATH: "$HOME/.poetry/bin"
jobs:
code_analysis:
name: Code Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
run: make environment
- name: Add Poetry Path
run: echo ${{ env.POETRY_PATH }} >> $GITHUB_PATH
- name: Install Dependencies
run: make install
- name: Lint
run: make lint
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
linux_check:
name: Linux Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
run: make environment
- name: Add Poetry Path
run: echo ${{ env.POETRY_PATH }} >> $GITHUB_PATH
- name: Install Dependencies
run: make install
- name: Build
run: make build validate
- name: Full Test Suite & Coverage
run: make coverage
mac_check:
name: MacOS Check
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
run: make environment
- name: Add Poetry Path
run: echo ${{ env.POETRY_PATH }} >> $GITHUB_PATH
- name: Install Dependencies
run: make install
- name: Build
run: make build validate
- name: Integration Tests
run: make test-integration
release:
name: Release
runs-on: ubuntu-latest
needs: [code_analysis, mac_check, linux_check]
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
run: make environment
- name: Add Poetry Path
run: echo ${{ env.POETRY_PATH }} >> $GITHUB_PATH
- name: Install Dependencies
run: make install
- name: Get Version
run: echo "PACKAGE_VERSION=$(echo $VERSION | poetry version --short)" >> $GITHUB_ENV
- name: Generate release notes
run: make release-notes
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.PACKAGE_VERSION }}
release_name: Release ${{ env.PACKAGE_VERSION }}
draft: false
prerelease: false
- name: Dependency Graph
run: make dependency-graph-ci
- name: Upload Dependency Graph as Artifact
uses: actions/upload-artifact@v2
with:
name: dependency-graph
path: dependency-graph.svg
- name: Build
run: make build
- name: Upload Package as Artifact
uses: actions/upload-artifact@v2
with:
name: package
path: dist/
- name: Upload Package to PyPi
env:
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: make publish-ci
- name: Zip Artifacts
run: make release-zip-ci
- name: Add Artifacts to Release
id: upload-release-asset_1
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./electionguard.zip
asset_name: electionguard.zip
asset_content_type: application/zip
- name: Deploy Github Pages
run: make docs-deploy-ci