Skip to content

Commit

Permalink
Added release file
Browse files Browse the repository at this point in the history
  • Loading branch information
JayEviden authored Nov 13, 2024
1 parent 8bd3f64 commit 9d69a0a
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This pipeline is designed to create a wheel and publich the wheel on
# GitHub

# Execute pipeline only on a new tag, if the tag
# if named "v*" (e.g. v1.0)
on:
push:
tags:
- 'v*'


# Pipeline name
name: Create new release


# Run pipeline
jobs:
build:
name: Build package
uses: ./.github/workflows/python-app.yml
deploy:
name: Deploy package
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install build
- name: Compute release version
run: |
TAG=${{ github.ref }}
echo "VERSION=${TAG#refs/tags/v}" >> $GITHUB_ENV
echo "The release version if ${TAG#refs/tags/v}"
- name: Create wheel
env:
TAG_NAME: ${{ env.VERSION }}
run: python -m build
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/mylib-${{ env.VERSION }}-py3-none-any.whl
asset_name: mylib-${{ env.VERSION }}-py3-none-any.whl
asset_content_type: application/x-wheel+zip

0 comments on commit 9d69a0a

Please sign in to comment.