summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/pyinstaller-release.yaml49
-rw-r--r--.github/workflows/release-on-tag.yaml23
-rw-r--r--pix.spec2
3 files changed, 61 insertions, 13 deletions
diff --git a/.github/workflows/pyinstaller-release.yaml b/.github/workflows/pyinstaller-release.yaml
index 44e2716..a4255b7 100644
--- a/.github/workflows/pyinstaller-release.yaml
+++ b/.github/workflows/pyinstaller-release.yaml
@@ -5,11 +5,8 @@ on:
types: [created]
jobs:
- build:
+ webpack:
runs-on: ubuntu-latest
- strategy:
- matrix:
- arch: [x64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -27,11 +24,14 @@ jobs:
working-directory: ./static
run: npx webpack
- - name: Set up QEMU for cross-architecture
- if: matrix.arch == 'arm64'
- uses: docker/setup-qemu-action@v3
- with:
- platforms: arm64
+ pyinstaller:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ arch: [x64, arm64]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
# - name: Run pyinstaller
# uses: sayyid5416/pyinstaller@v1
@@ -42,6 +42,12 @@ jobs:
# #upload_exe_with_name: 'pix'
# options: --onefile
+ - name: Set up QEMU for cross-architecture
+ if: matrix.arch == 'arm64'
+ uses: docker/setup-qemu-action@v3
+ with:
+ platforms: arm64
+
- name: Set up Python
uses: actions/setup-python@v5
with:
@@ -64,13 +70,32 @@ jobs:
TARGET_ARCH: ${{ matrix.arch }}
run: |
if [ "${{ matrix.arch }}" = "arm64" ]; then
- pyinstaller --onefile --target-arch aarch64 pix.py
+ pyinstaller --onefile --target-arch aarch64 pix.spec
else
- pyinstaller --onefile pix.py
+ pyinstaller --onefile pix.spec
fi
+ - name: Rename the executable
+ run: |
+ mv ./dist/pix ./dist/pixpy-${{ matrix.arch }}
+
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: pixpy-${{ matrix.arch }}
- path: dist/pix
+ path: ./dist/pixpy-${{ matrix.arch }}
+
+ release:
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Create Release and Upload Assets
+ uses: softprops/action-gh-release@v2
+ with:
+ files: |
+ ./dist/pixpy-*
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release-on-tag.yaml b/.github/workflows/release-on-tag.yaml
new file mode 100644
index 0000000..ef4c91c
--- /dev/null
+++ b/.github/workflows/release-on-tag.yaml
@@ -0,0 +1,23 @@
+name: Create Release
+
+on:
+ push:
+ tags:
+ - 'v*' # This will trigger the action when you push a tag like v1.0, v1.1, etc.
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up Git
+ run: |
+ git config user.name "GitHub Actions"
+ git config user.email "actions@github.com"
+
+ - name: Create Release
+ uses: softprops/action-gh-release@v2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub Actions
diff --git a/pix.spec b/pix.spec
index c14fa14..e6d7e7e 100644
--- a/pix.spec
+++ b/pix.spec
@@ -12,7 +12,7 @@ a = Analysis(
runtime_hooks=[],
excludes=[],
noarchive=False,
- optimize=0,
+ optimize=2,
)
pyz = PYZ(a.pure)