-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (57 loc) · 1.72 KB
/
release.yml
File metadata and controls
62 lines (57 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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/neasqcvariational-${{ env.VERSION }}-py3-none-any.whl
asset_name: neasqcvariational-${{ env.VERSION }}-py3-none-any.whl
asset_content_type: application/x-wheel+zip