-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (90 loc) · 3.04 KB
/
release-please.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
# https://github.com/GoogleCloudPlatform/release-please-action
on:
push:
branches:
- main
name: release-please
jobs:
release-please-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: release-pr
uses: GoogleCloudPlatform/release-please-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
package-name: AnkiFinnish
command: release-pr
path: anki/
default-branch: main
- id: label
if: ${{ steps.release-pr.outputs.pr }}
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
await github.issues.addLabels({
owner,
repo,
issue_number: ${{steps.release-pr.outputs.pr}},
labels: ['autorelease: pending']
});
console.log(`Tagged ${{steps.release-pr.outputs.pr}}`)
release-please-release:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
package-name: AnkiFinnish
command: github-release
path: anki/
default-branch: main
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-python@v2
if: ${{ steps.release.outputs.release_created }}
with:
python-version: 3.9
- name: Build
if: ${{ steps.release.outputs.release_created }}
run: |
cd anki
python -m pip install --upgrade mypy aqt pipenv pyqt6 wheel
mypy .
./package.sh
mv AnkiFinnish.zip AnkiFinnish-${{ steps.release.outputs.tag_name }}.zip
- name: Upload
uses: softprops/action-gh-release@v1
if: ${{ steps.release.outputs.release_created }}
with:
files: anki/AnkiFinnish-${{ steps.release.outputs.tag_name }}.zip
tag_name: ${{ steps.release.outputs.tag_name }}
name: AnkiFinnish ${{ steps.release.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v3
if: ${{ steps.release.outputs.release_created }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
await github.issues.addLabels({
owner,
repo,
issue_number: ${{steps.release.outputs.pr}},
labels: ['autorelease: published']
});
github.issues.removeLabel({
owner,
repo,
issue_number: ${{steps.release.outputs.pr}},
name: 'autorelease: tagged',
});
console.log(`Tagged ${{steps.release.outputs.pr}}`)