Skip to content

Create Release

Create Release #88

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: version string (eg. 6.1)
required: true
permissions:
contents: write
jobs:
create-release:
name: Version ${{ github.event.inputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
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 master
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 "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "module_name=$(ls src)" >> $GITHUB_OUTPUT
echo "build_name=$(ls build | grep --color=never .ankiaddon)" >> $GITHUB_OUTPUT
- name: Create github release and upload ankiaddon file
uses: softprops/action-gh-release@v2
with:
token: ${{ github.token }}
files: build/${{ steps.vars.outputs.build_name }}
tag_name: ${{ github.event.inputs.version }}
name: ${{ steps.vars.outputs.module_name }} v${{ github.event.inputs.version }}