Upload Release Asset #40
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# matrixctl | |
# Copyright (c) 2020 Michael Sasser <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. | |
--- | |
name: Upload Release Asset | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Python 3.10 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/[email protected] | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Build project | |
run: poetry build | |
- name: Zip project | |
run: zip --junk-paths matrixctl.zip dist/* README.md LICENSE.txt | |
- name: Generate changelog_latest.rst from CHANGELOG.rst | |
run: python scripts/get_latest_release.py | |
- name: Convert from changelog_latest.rst to changelog_latest.md | |
uses: docker://pandoc/core:2.16.2 | |
with: | |
args: >- | |
--output=chagelog_latest.md | |
--from rst | |
--to markdown | |
--markdown-headings=atx | |
chagelog_latest.rst | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: false | |
draft: false | |
name: Release ${{ steps.get_version.outputs.VERSION }} | |
body_path: chagelog_latest.md | |
files: matrixctl.zip | |
- name: Delete temp files | |
run: rm -rf matrixctl.zip chagelog_latest.md chagelog_latest.rst | |
- name: pypi-publish | |
uses: pypa/[email protected] | |
with: | |
# PyPI user | |
# user: # optional, default is __token__ | |
# Password for your PyPI user or an access token | |
password: ${{ secrets.pypi_token }} | |
# The repository URL to use | |
# repository_url: # optional | |
# The target directory for distribution | |
# packages_dir: # optional, default is dist |