Skip to content

Update release.yaml

Update release.yaml #7

Workflow file for this run

name: CI
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
build-and-publish:
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install build dependencies
run: |
python -m pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt
- name: Build and install wheel
run: |
tox run -m build
- name: "Publish distribution 📦 to PyPI"
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Build ComicTagger plugin zip
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
python -m pip install dist/*.whl -t build
cd build
zip -x "*/__pycache__/*" -r ../dist/${{ github.event.repository.name }}-plugin-${{ github.ref_name }}.zip *
- name: Get release name
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* # github is dumb
echo "release_name=$(git tag -l --format "%(refname:strip=2): %(contents:lines=1)" ${{ github.ref_name }})" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: "${{ env.release_name }}"
draft: false
files: |
dist/*.zip