Skip to content

Commit 4df6c4b

Browse files
Antony BaileyAntony Bailey
authored andcommitted
lets get publishing
1 parent 25bfea6 commit 4df6c4b

File tree

2 files changed

+61
-3
lines changed

2 files changed

+61
-3
lines changed

.github/workflows/python-publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
name: Upload Python Package
44

55
on:
6-
push:
7-
tags:
8-
- v* # Run when any tag starting with 'v' is pushed
6+
release:
7+
types: [published]
98

109
permissions:
1110
contents: read

.github/workflows/release-tags.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release on Tags
2+
3+
on:
4+
push:
5+
tags:
6+
- v* # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.x'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install setuptools wheel twine
30+
31+
- name: Extract tag name
32+
id: tag
33+
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
34+
35+
- name: Build and package
36+
run: |
37+
python setup.py sdist bdist_wheel
38+
39+
- name: Create Release
40+
id: create_release
41+
uses: actions/create-release@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tag_name: ${{ env.TAG_NAME }}
46+
release_name: Release ${{ env.TAG_NAME }}
47+
draft: false
48+
prerelease: false
49+
50+
- name: Upload Release Assets
51+
uses: actions/upload-release-asset@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
upload_url: ${{ steps.create_release.outputs.upload_url }}
56+
asset_path: ./dist/*
57+
asset_name: pySQLY-${{ env.TAG_NAME }}.tar.gz
58+
asset_content_type: application/gzip
59+

0 commit comments

Comments
 (0)