-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (60 loc) · 2.08 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
# Release workflow for push commits to the master branch
# This workflow uses python semantic releases, which relies on certain commit tags to
# determine if a new release/version should be created.
# Checkout https://github.com/python-semantic-release/python-semantic-release form more
# info on how to use it.
# Also checkout https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type to
# which types of commit messages are accepted
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
concurrency: push
if: github.repository == 'swvanbuuren/simple-cdd-yaml'
environment:
name: pypi
url: https://pypi.org/project/simple-cdd-yaml/
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
if: steps.release.outputs.released == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
if: steps.release.outputs.released == 'true'
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
if: steps.release.outputs.released == 'true'
run: python -m build
- name: Publish package distributions to PyPI
id: pypi-publish
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
- name: Publish package distributions to GitHub Releases
id: github-release
if: steps.release.outputs.released == 'true'
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}