Skip to content

Commit

Permalink
github publish hawc client (#1124)
Browse files Browse the repository at this point in the history
* add publish action

* rename

* temporarily add pull_request scope

* fix name

* fix secret?

* read error message

* push to PyPI after testing

* fix issue with djhtml on windows

* dont build wheels
  • Loading branch information
shapiromatron authored Nov 3, 2024
1 parent 029ec3b commit 4612bd8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: publish

on:
push:
tags:
- "hawc-client-[0-9]+.[0-9]+"

jobs:
publish-hawc-client:
runs-on: ubuntu-22.04

permissions:
id-token: write

environment:
name: publish
url: https://pypi.org/project/hawc-client/

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
cache: 'pip'

- name: install
run: python -m pip install -U pip wheel flit

- name: Build client
run: cd client && flit build

- name: Publish package to PyPI
env:
PUBLISH_PYPI: ${{ secrets.PUBLISH_PYPI }}
if: env.PUBLISH_PYPI != null
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://pypi.org/legacy/
verbose: true
attestations: true
print-hash: true
packages-dir: client/dist/
4 changes: 4 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@ECHO off

:: Windows still uses legacy code pages instead of UTF-8
:: required for djhtml to work properly
set PYTHONUTF8=1

if "%~1" == "" goto :help
if /I %1 == help goto :help
if /I %1 == sync-dev goto :sync-dev
Expand Down

0 comments on commit 4612bd8

Please sign in to comment.