From dc09d925fbbb4b9a4db2c7262df977beb014c72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Mon, 11 Nov 2024 15:23:48 +0100 Subject: [PATCH 1/5] Fix standalone release platforms --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04d076a..0ab79df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,10 +87,10 @@ jobs: - uses: actions/upload-artifact@v4 with: path: docs/_build/html/* + name: docs build-wheel-sdist: needs: - - lint - test - test-docs name: Build package @@ -112,8 +112,10 @@ jobs: build-standalone-dist: name: Build standalone - needs: build-wheel-sdist - runs-on: ubuntu-latest + needs: + - test + - test-docs + runs-on: ${{ matrix.runs-on }} strategy: fail-fast: false matrix: @@ -121,7 +123,7 @@ jobs: - ubuntu-latest # ARM - macos-14 - # X86 + # X86_64 - macos-13 - windows-latest steps: @@ -130,21 +132,28 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.11" + - name: Install PyInstaller + if: matrix.runs-on == 'macos-13' || matrix.runs-on == 'macos-14' + run: pip install -U pyinstaller - name: Install dependencies + if: matrix.runs-on == 'windows-latest' + shell: bash run: | pip install -U pyinstaller - sudo apt install upx + choco install -y upx + - name: Install dependencies + if: matrix.runs-on == 'ubuntu-latest' + run: | + pip install -U pyinstaller + sudo apt-get install -y upx-ucl - name: Install package run: pip install . - name: Build standalone distribution shell: bash run: sh scripts/build.sh - name: Compress with UPX - run: | - upx --best -9 dist/md2po - upx --best -9 dist/po2md - upx --best -9 dist/md2po2md - upx --best -9 dist/mdpo2html + if: matrix.runs-on != 'macos-latest' + run: upx -f --best -9 dist/* - name: Prepare upload run: | mv dist/md2po dist/md2po-${{ matrix.runs-on }} @@ -162,6 +171,7 @@ jobs: name: Build final distribution runs-on: ubuntu-latest needs: + - lint - build-wheel-sdist - build-standalone-dist steps: @@ -179,7 +189,7 @@ jobs: uses: actions/download-artifact@v4 with: name: macos-13-build - path: ./build/mac-x64 + path: ./build/mac-x86_64 - name: Download Linux artifact uses: actions/download-artifact@v4 with: @@ -198,20 +208,20 @@ jobs: mv md2po2md-ubuntu-latest md2po2md mv mdpo2html-ubuntu-latest mdpo2html cd ../.. - tar -czf dist/mdpo-linux-x64.tar.gz -C build/linux \ + tar -czf dist/mdpo-linux-x86_64.tar.gz -C build/linux \ md2po po2md md2po2md mdpo2html - name: Create MacOS tarballs run: | cd build - mv mac-x64/md2po-macos-13 mac-x64/md2po + mv mac-x86_64/md2po-macos-13 mac-x86_64/md2po mv mac-arm64/md2po-macos-14 mac-arm64/md2po - mv mac-x64/po2md-macos-13 mac-x64/po2md + mv mac-x86_64/po2md-macos-13 mac-x86_64/po2md mv mac-arm64/po2md-macos-14 mac-arm64/po2md - mv mac-x64/md2po2md-macos-13 mac-x64/md2po2md + mv mac-x86_64/md2po2md-macos-13 mac-x86_64/md2po2md mv mac-arm64/md2po2md-macos-14 mac-arm64/md2po2md - mv mac-x64/mdpo2html-macos-13 mac-x64/mdpo2html + mv mac-x86_64/mdpo2html-macos-13 mac-x86_64/mdpo2html mv mac-arm64/mdpo2html-macos-14 mac-arm64/mdpo2html - tar -czf ../dist/mdpo-mac-x64.tar.gz -C mac-x64 \ + tar -czf ../dist/mdpo-mac-x86_64.tar.gz -C mac-x86_64 \ md2po po2md md2po2md mdpo2html tar -czf ../dist/mdpo-mac-arm64.tar.gz -C mac-arm64 \ md2po po2md md2po2md mdpo2html @@ -222,7 +232,7 @@ jobs: mv po2md-windows-latest po2md.exe mv md2po2md-windows-latest md2po2md.exe mv mdpo2html-windows-latest mdpo2html.exe - 7z a -tzip ../../dist/mdpo-windows-x64.zip \ + 7z a -tzip ../../dist/mdpo-windows-x86_64.zip \ md2po.exe po2md.exe md2po2md.exe mdpo2html.exe - name: Remove build directories run: rm -rf build @@ -246,7 +256,6 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - # repository_url: https://test.pypi.org/legacy/ skip-existing: true release: From 92f4270013b2b0c648e137b10d567c988426df8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Mon, 11 Nov 2024 15:25:31 +0100 Subject: [PATCH 2/5] Fix error --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ab79df..2f38e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ jobs: shell: bash run: sh scripts/build.sh - name: Compress with UPX - if: matrix.runs-on != 'macos-latest' + if: matrix.runs-on != 'macos-13' && matrix.runs-on != 'macos-14' run: upx -f --best -9 dist/* - name: Prepare upload run: | From 733dc73bde97b5f0450fc7ad65af188b7ca510d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Mon, 11 Nov 2024 15:31:17 +0100 Subject: [PATCH 3/5] Improve release logic --- .github/workflows/ci.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f38e17..915233d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,22 +278,18 @@ jobs: TAG_BODY="${TAG_BODY//$'\n'/'%0A'}" TAG_BODY="${TAG_BODY//$'\r'/'%0D'}" echo "body=$TAG_BODY" >> $GITHUB_OUTPUT + - uses: actions/download-artifact@v4 + name: Download builds + with: + name: dist + path: ./dist - name: Create Release uses: softprops/action-gh-release@v2 - id: create-release with: name: ${{ steps.tag.outputs.title }} tag_name: ${{ steps.tag.outputs.title }} body: ${{ steps.tag.outputs.body }} draft: false prerelease: false - - uses: actions/download-artifact@v4 - name: Download builds - with: - name: dist - path: ./dist - - uses: shogo82148/actions-upload-release-asset@v1 - name: Upload release assets - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: dist/* + files: | + dist/* From 1f84b8ad2482b03300f7f20d962a592d585f7f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Mon, 11 Nov 2024 15:35:10 +0100 Subject: [PATCH 4/5] better --- .github/workflows/ci.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 915233d..adf06bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,19 +133,14 @@ jobs: with: python-version: "3.11" - name: Install PyInstaller - if: matrix.runs-on == 'macos-13' || matrix.runs-on == 'macos-14' run: pip install -U pyinstaller - - name: Install dependencies + - name: Install UPX if: matrix.runs-on == 'windows-latest' shell: bash - run: | - pip install -U pyinstaller - choco install -y upx - - name: Install dependencies + run: choco install -y upx + - name: Install UPX if: matrix.runs-on == 'ubuntu-latest' - run: | - pip install -U pyinstaller - sudo apt-get install -y upx-ucl + run: sudo apt-get install -y upx-ucl - name: Install package run: pip install . - name: Build standalone distribution From f08af8f906ebafb2ced69f4ddec01b87b85c40dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Mon, 11 Nov 2024 15:38:48 +0100 Subject: [PATCH 5/5] Fix for Windows --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adf06bd..39e52f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,6 +149,12 @@ jobs: - name: Compress with UPX if: matrix.runs-on != 'macos-13' && matrix.runs-on != 'macos-14' run: upx -f --best -9 dist/* + - if: matrix.runs-on == 'windows-latest' + run: | + mv dist/md2po.exe dist/md2po + mv dist/po2md.exe dist/po2md + mv dist/md2po2md.exe dist/md2po2md + mv dist/mdpo2html.exe dist/mdpo2html - name: Prepare upload run: | mv dist/md2po dist/md2po-${{ matrix.runs-on }}