Skip to content

Update Release.yml

Update Release.yml #16

Workflow file for this run

name: build & release
on:
push:
branches:
- "master"
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
python-versions: ['3.10']
outputs:
package_version: ${{ steps.variables_step.outputs.package_version }}
package_name: ${{ steps.variables_step.outputs.package_name }}
repo_name: ${{ steps.variables_step.outputs.repo_name }}
repo_owner: ${{ steps.variables_step.outputs.repo_owner }}
steps:
- uses: actions/checkout@v3
- name: build change log
id: build_changelog
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-versions }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox-gh-actions poetry
- name: Declare variables for convenient use
id: variables_step
run: |
echo "::set-output name=repo_owner::${GITHUB_REPOSITORY%/*}"
echo "::set-output name=repo_name::${GITHUB_REPOSITORY#*/}"
echo "::set-output name=package_name::$(poetry version | awk '{print $1}')"
echo "::set-output name=package_version::$(poetry version --short)"
shell: bash
- name: Build wheels and source tarball
run: |
poetry lock
poetry build
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ steps.build_changelog.outputs.changelog }}
repository: PyDFIR/pyDFIRRam
#token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Publish to PYPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true