-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
40 deletions.
There are no files selected for viewing
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,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: | ||
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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 }} |