-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (38 loc) · 1.72 KB
/
github-actions-all-in-one.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
name: Build, Test and publish Release
run-name: Building, testing and publishing
on: [push]
jobs:
Build-Test-and-Publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: install deps
run: 'sudo apt update && sudo apt install nsis && pip install wheel pynsist && pip install -r requirements.in -c requirements.txt'
- run: 'sed -i -e "s/^version=0\\.0$/version=${GITHUB_REF_NAME}/g" pynsist.cfg'
- run: "python -c 'import textwrap; new_content = open(\"pynsist.cfg\", \"r\", encoding=\"utf-8\").read().replace(\"WHEELS_REPLACEME\", textwrap.indent(\"\\n\".join(filter(lambda l: \"#\" not in l, open(\"requirements.txt\", \"r\", encoding=\"utf-8\").read().splitlines())), \" \")); open(\"pynsist.cfg\", \"w\", encoding=\"utf-8\").write(new_content)'"
- name: basic test
run: './workflow_templater/__init__.py --dry-run --verbose ./examples/basic_release_example/'
- name: build Windows installer
run: pynsist pynsist.cfg
- name: build sdist
run: python setup.py sdist
- name: build wheel
run: python setup.py bdist_wheel
- name: Github Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
draft: false
files: |
build/nsis/Workflow_Templater_*.exe
dist/*
- name: PyPI Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1