forked from ploomber/jupysql-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.51 KB
/
build.yml
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
name: Build
on: [push]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
sudo apt-get update && sudo apt-get install -y jq nodejs
- name: Build wheel
run: |
make wheel
- name: Test tag and version consistency
id: test_consistency
if: startsWith(github.ref, 'refs/tags/')
run: |
bin/test-version-tag
echo "VERSION=$(bin/print-version)" >> "$GITHUB_OUTPUT"
- name: Create release
id: create_release
if: startsWith(github.ref, 'refs/tags/v') && steps.test_consistency.outcome == 'success'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Version ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload release wheel
id: upload_release
if: steps.create_release.outcome == 'success'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/jupysql_plugin-${{ steps.test_consistency.outputs.VERSION }}-py3-none-any.whl
asset_name: jupysql_plugin-${{ steps.test_consistency.outputs.VERSION }}-py3-none-any.whl
asset_content_type: application/whl