Skip to content

fix: cleanup

fix: cleanup #99

# 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}}`)