Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ston14 authored Jun 30, 2024
1 parent cfc9e25 commit 3a758f1
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# Publish package on release branch if it's tagged with 'v*'

name: build & release

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- "master"
tags:
- 'v*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -23,32 +16,30 @@ jobs:
matrix:
python-versions: ['3.10']

# authorize job to read secrets
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
actions: write
repository-projects: write

# map step outputs to job outputs so they can be share among jobs
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 represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- 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@v2
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-versions }}

Expand All @@ -57,14 +48,13 @@ jobs:
python -m pip install --upgrade pip
pip install tox-gh-actions poetry
# declare package_version, repo_owner, repo_name, package_name so you may use it in web hooks.
- 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`"
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
Expand All @@ -84,7 +74,7 @@ jobs:
draft: false
prerelease: false

- name: publish to PYPI
- name: Publish to PYPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down

0 comments on commit 3a758f1

Please sign in to comment.