forked from sebastiaanbrand/ft-2-quantum-sat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
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 |