-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Github action for "release" and "publish_package" (#152)
- Loading branch information
1 parent
147785b
commit 2b8ef5b
Showing
7 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
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,25 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
categories: | ||
- title: Breaking Changes 💥 | ||
labels: | ||
- Semver-Major | ||
- breaking-change | ||
- title: Exciting New Features 🎉 | ||
labels: | ||
- enhancement | ||
- feature | ||
- title: Bug Fix 🐛 | ||
labels: | ||
- bug-fix | ||
- title: Dependencies Update 📦 | ||
labels: | ||
- dependencies | ||
- title: Documentation 📝 | ||
labels: | ||
- documentation | ||
- title: Other Changes | ||
labels: | ||
- "*" |
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,26 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
name: Create Release | ||
|
||
jobs: | ||
create-github-release: | ||
name: Create GitHub Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Read version | ||
id: read-version | ||
run: | | ||
version=$(<wapi/VERSION) | ||
echo "VERSION=$version" >> "$GITHUB_OUTPUT" | ||
echo "version is $version" | ||
- name: Create Release | ||
run: gh release create ${{ steps.read-version.outputs.VERSION }} --generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,56 @@ | ||
name: Publish package | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version to publish" | ||
required: false | ||
default: "" | ||
|
||
jobs: | ||
publish-package: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.11 | ||
|
||
- run: pip install -U twine wheel | ||
|
||
- name: Read version | ||
id: read-version | ||
run: | | ||
# override VERSION file with input from dispatch action | ||
if [ ${{ github.event_name }} == "workflow_dispatch" ]; then | ||
version_input=${{ github.event.inputs.version }} | ||
echo $version_input > wapi/VERSION | ||
fi | ||
version=$(<wapi/VERSION) | ||
echo "VERSION=$version" >> "$GITHUB_OUTPUT" | ||
echo "version is $version" | ||
- name: Build dist | ||
id: build-dist | ||
run: | | ||
VERSION=${{ steps.read-version.outputs.VERSION }} | ||
rm -rf dist | ||
python setup.py sdist bdist_wheel | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: dist/ |
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
File renamed without changes.
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# | ||
# Wattsight API access library | ||
# | ||
|
||
import os | ||
from .session import Session | ||
from . import auth, curves, events, session, util | ||
|
||
VERSION = __version__ = '0.7.11' | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(here, 'VERSION')) as fv: | ||
VERSION = __version__ = fv.read().strip() |