Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdvs committed Sep 11, 2024
1 parent 4336fda commit c818b4a
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: release

on:
push:
tags:
- v[0-9]+.[0-9]+.?[0-9]*
pull_request
# push:
# tags:
# - v[0-9]+.[0-9]+.?[0-9]*

jobs:
build:
Expand Down Expand Up @@ -52,7 +53,7 @@ jobs:
bash scripts/install_patched_orjson.sh
pyinstaller src/fig2sketch.py -y --onefile --target-arch ${{ matrix.arch }}
- name: Rename binary
run: mv dist/fig2sketch${{ matrix.ext }} dist/fig2sketch-${{ github.ref_name }}${{ matrix.ext }}
run: mv dist/fig2sketch${{ matrix.ext }} dist/fig2sketch-release-test${{ matrix.ext }}
- name: zip release
uses: thedoctor0/zip-release@main
with:
Expand All @@ -71,7 +72,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
name: builds
- name: Create universal binary with lipo
Expand All @@ -90,10 +91,10 @@ jobs:
mkdir -p dist
unzip fig2sketch-macos-x86_64.zip -d x86_64/
unzip fig2sketch-macos-arm64.zip -d arm64/
hexdump -ve '1/1 "%.2X"' x86_64/fig2sketch-${{ github.ref_name }} | sed "s/4D45490\([0C]\)0B0A0B0E/4D45490\10B0A0B0F/g" | xxd -r -p > x86_64/fig2sketch.patched
hexdump -ve '1/1 "%.2X"' x86_64/fig2sketch-release-test | sed "s/4D45490\([0C]\)0B0A0B0E/4D45490\10B0A0B0F/g" | xxd -r -p > x86_64/fig2sketch.patched
codesign --remove x86_64/fig2sketch.patched
codesign -s - x86_64/fig2sketch.patched
lipo -create x86_64/fig2sketch.patched arm64/fig2sketch-${{ github.ref_name }} -output dist/fig2sketch-${{ github.ref_name }}
lipo -create x86_64/fig2sketch.patched arm64/fig2sketch-release-test -output dist/fig2sketch-release-test
- name: zip release
uses: thedoctor0/zip-release@main
with:
Expand All @@ -102,41 +103,41 @@ jobs:
directory: "dist"
path: "*"
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: builds
path: dist/fig2sketch-macos-universal.zip

create-release:
needs: [build, build-macos-universal]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Download artifacts
uses: actions/[email protected]
with:
name: builds
- uses: ncipollo/release-action@v1
with:
artifacts: "fig2sketch-*.zip"
generateReleaseNotes: true
# create-release:
# needs: [build, build-macos-universal]
# runs-on: ubuntu-latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - name: Download artifacts
# uses: actions/[email protected]
# with:
# name: builds
# - uses: ncipollo/release-action@v1
# with:
# artifacts: "fig2sketch-*.zip"
# generateReleaseNotes: true

publish-to-pypi:
name: Build and publish to PyPi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install build tools
run: pip install build
- name: Build source distribution
run: python -m build --sdist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# publish-to-pypi:
# name: Build and publish to PyPi
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: "3.11"
# - name: Install build tools
# run: pip install build
# - name: Build source distribution
# run: python -m build --sdist
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit c818b4a

Please sign in to comment.