Skip to content

Commit 39bb67c

Browse files
authored
Merge pull request #35 from con/unsplit-release
Resimplify release workflow
2 parents 35ae3a4 + 569f6d4 commit 39bb67c

File tree

2 files changed

+13
-43
lines changed

2 files changed

+13
-43
lines changed

.autorc

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,13 @@
33
"baseBranch": "master",
44
"author": "auto <auto@nil>",
55
"noVersionPrefix": true,
6-
"plugins": ["git-tag"]
6+
"plugins": [
7+
"git-tag",
8+
[
9+
"exec",
10+
{
11+
"afterRelease": "python -m build && twine upload dist/*"
12+
}
13+
]
14+
]
715
}

.github/workflows/release.yml

+4-42
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
auto-release:
1111
runs-on: ubuntu-latest
1212
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
13-
outputs:
14-
auto-version: ${{ steps.auto-version.outputs.version }}
1513
steps:
1614
- name: Checkout source
1715
uses: actions/checkout@v2
@@ -24,54 +22,18 @@ jobs:
2422
wget -O- "$auto_download_url" | gunzip > ~/auto
2523
chmod a+x ~/auto
2624
27-
- name: Check whether a release is due
28-
id: auto-version
29-
run: |
30-
version="$(~/auto version)"
31-
echo "::set-output name=version::$version"
32-
env:
33-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- name: Create release
36-
run: ~/auto shipit
37-
env:
38-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
40-
pypi:
41-
runs-on: ubuntu-latest
42-
needs: auto-release
43-
if: "needs.auto-release.outputs.auto-version != ''"
44-
steps:
45-
# By default, actions/checkout will checkout the commit that that was
46-
# pushed to master and triggered the workflow, but this does not include
47-
# the commit & tag created by `auto`. In order to get that, we need to
48-
# look up the tag for the latest release.
49-
- name: Get tag of latest release
50-
id: latest-release
51-
run: |
52-
latest_tag="$(curl -fsSL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .tag_name)"
53-
echo "::set-output name=tag::$latest_tag"
54-
55-
- name: Checkout source
56-
uses: actions/checkout@v2
57-
with:
58-
fetch-depth: 0
59-
ref: ${{ steps.latest-release.outputs.tag }}
60-
6125
- name: Set up Python
6226
uses: actions/setup-python@v2
6327
with:
6428
python-version: '^3.6'
6529

66-
- name: Install build & twine
30+
- name: Install Python dependencies
6731
run: python -m pip install build twine
6832

69-
- name: Build
70-
run: python -m build
71-
72-
- name: Upload
73-
run: twine upload dist/*
33+
- name: Create release
34+
run: ~/auto shipit
7435
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7537
TWINE_USERNAME: __token__
7638
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
7739

0 commit comments

Comments
 (0)