Skip to content

Create Add-on Release #61

Create Add-on Release

Create Add-on Release #61

Workflow file for this run

name: Create Add-on Release
on:
workflow_dispatch:
inputs:
version:
description: version string (eg. 6.1)
required: true
jobs:
create-release:
name: Version ${{ github.event.inputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install git+https://github.com/glutanimate/anki-addon-builder.git@4039b5bb743773a18cb2911e6dd38fa1e3f65982
python -m pip install pyqt5
- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: commit version bump and create tag
run: |
git commit --allow-empty -m "Bump Version to v${{ github.event.inputs.version }}"
git push origin main
git tag ${{ github.event.inputs.version }}
git push origin tag ${{ github.event.inputs.version }}
- name: Create ankiaddon file
run: aab build -d ankiweb
- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=module_name::$(ls src)"
echo "::set-output name=build_name::$(ls build | grep --color=never .ankiaddon)"
- name: Create github release and upload ankiaddon file
uses: svenstaro/[email protected]
with:
repo_token: ${{ github.token }}
file: build/${{ steps.vars.outputs.build_name }}
tag: ${{ github.event.inputs.version }}
release_name: ${{ steps.vars.outputs.module_name }} v${{ github.event.inputs.version }}