Skip to content

Commit

Permalink
disable wxURL, disable command-line utils, use UPX
Browse files Browse the repository at this point in the history
  • Loading branch information
matyalatte committed Jun 10, 2023
1 parent 7fa3bfb commit 9f882d4
Show file tree
Hide file tree
Showing 19 changed files with 622 additions and 133 deletions.
81 changes: 66 additions & 15 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.check-tag.outputs.tag }}
url: ${{ steps.create-release.outputs.upload_url }}
wx_version: ${{ steps.wx-version.outputs.version }}
steps:

Expand Down Expand Up @@ -45,9 +44,19 @@ jobs:
tag_name: ${{ steps.check-tag.outputs.tag }}
name: ${{ steps.check-tag.outputs.tag }}
body: |
Changelog
## Changelog
- First Change
- Second Change
## Notes
- `*-packed.*` are the 1MB executables that were compressed by [UPX](https://github.com/upx/upx).
But they might cause some problems (e.g. false positives by anti-viruses) on your machine.
Use the uncompressed ones if they won't work.
- The linux builds only support Ubuntu 20.04 or later due to the glibc dependencies.
Build the executable by yourself if you want to use it on other linux distros.
draft: true
prerelease: false

Expand All @@ -57,7 +66,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Cache wxWidget
- name: Cache wxWidgets
uses: actions/cache@v3
id: cache-wx
with:
Expand All @@ -84,52 +93,71 @@ jobs:
cp changelog.txt archive
cp license.txt archive
shell: bash

- name: Archive Release
uses: thedoctor0/zip-release@master
with:
directory: 'archive'
type: 'zip'
filename: '${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.zip'

- name: Upload Release Asset
- name: copy files
run: mv archive/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.zip ./
shell: bash

- name: Compress exe with UPX
uses: crazy-max/ghaction-upx@v2
with:
version: latest
files: ./archive/SimpleCommandRunner.exe
args: --best

- name: Archive Release
uses: thedoctor0/zip-release@master
with:
directory: 'archive'
type: 'zip'
filename: '${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}-packed.zip'

- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.setup.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.zip
run: |
gh release upload ${{ needs.setup.outputs.tag }} ${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.zip
gh release upload ${{ needs.setup.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}-packed.zip
build_unix:
strategy:
matrix:
os: [ubuntu-20.04, macos-11]

runs-on: ${{ matrix.os }}
needs: setup
steps:
- uses: actions/checkout@v3

- name: Cache wxWidget
- name: Cache wxWidgets
uses: actions/cache@v3
id: cache-wx
with:
path: "~/wxWidgets-${{ needs.setup.outputs.wx_version }}"
key: ${{ runner.os }}-wx${{ needs.setup.outputs.wx_version }}

- name: install gtk
- name: install gtk for Linux
if: runner.os=='Linux'
run: |
sudo apt -y install libgtk-3-dev
run: sudo apt -y install libgtk-3-dev

- name: build wxWidget
- name: build wxWidgets
if: steps.cache-wx.outputs.cache-hit != 'true'
run: |
cd shell_scripts
bash download_wxWidgets.sh
bash build_wxWidgets.sh NoTest
- name: build exe
run: |
bash shell_scripts/build_exe.sh
run: bash shell_scripts/build_exe.sh

- name: copy files
- name: Archive Release
run: |
mkdir -p archive/${{ env.ZIP_NAME }}
cp build/Release/SimpleCommandRunner archive/${{ env.ZIP_NAME }}
Expand All @@ -138,8 +166,31 @@ jobs:
cp license.txt archive/${{ env.ZIP_NAME }}
cd archive
tar -jcvf ${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.tar.bz2 ${{ env.ZIP_NAME }}
mv ${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.tar.bz2 ../
- name: Install UPX for Linux
if: runner.os=='Linux'
uses: crazy-max/ghaction-upx@v2
with:
install-only: true

- name: Install UPX for macOS
if: runner.os == 'macOS'
run: brew install upx

- name: Compress exe with UPX
run: |
cd archive/${{ env.ZIP_NAME }}
upx SimpleCommandRunner --best
- name: Archive Release
run: |
cd archive
tar -jcvf ${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}-packed.tar.bz2 ${{ env.ZIP_NAME }}
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.setup.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.tar.bz2
run: |
gh release upload ${{ needs.setup.outputs.tag }} ${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.tar.bz2
gh release upload ${{ needs.setup.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}-packed.tar.bz2
34 changes: 26 additions & 8 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ jobs:

- uses: actions/checkout@v3

- name: Check wxWidget version
- name: Check wxWidgets version
id: wx-version
run: |
VERSION=$(cat WX_VERSION.txt)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
shell: bash

- name: Cache wxWidget
- name: Cache wxWidgets
uses: actions/cache@v3
id: cache-wx
with:
path: "~/wxWidgets-${{ steps.wx-version.outputs.version }}"
key: ${{ runner.os }}-wx${{ steps.wx-version.outputs.version }}

- name: build wxWidget
- name: build wxWidgets
if: steps.cache-wx.outputs.cache-hit != 'true'
run: |
cd shell_scripts
Expand All @@ -49,21 +49,37 @@ jobs:
run: |
bash shell_scripts/build_exe.sh
- name: copy files
- name: Archive Release
run: |
mkdir -p archive/${{ env.ZIP_NAME }}
cp build/Release/SimpleCommandRunner archive/${{ env.ZIP_NAME }}
cp examples/other_features/help/gui_definition.json archive/${{ env.ZIP_NAME }}
cp changelog.txt archive/${{ env.ZIP_NAME }}
cp license.txt archive/${{ env.ZIP_NAME }}
cd archive
tar -jcvf ${{ env.ZIP_NAME }}-${{ runner.os }}.tar.bz2 ${{ env.ZIP_NAME }}
tar -jcvf ${{ env.ZIP_NAME }}-mac-x64.tar.bz2 ${{ env.ZIP_NAME }}
mv ${{ env.ZIP_NAME }}-mac-x64.tar.bz2 ../
- name: Install UPX
run: brew install upx
if: runner.os == 'macOS'

- name: Compress exe with UPX
run: |
cd archive/${{ env.ZIP_NAME }}
upx SimpleCommandRunner --best
- name: Archive UPX Release
run: |
cd archive
tar -jcvf ${{ env.ZIP_NAME }}-mac-x64-upx.tar.bz2 ${{ env.ZIP_NAME }}
mv ${{ env.ZIP_NAME }}-mac-x64-upx.tar.bz2 ../
- name: Create Release Draft
id: create-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.check-tag.outputs.tag }}
tag_name: ${{ steps.check-tag.outputs.tag }}-mac
name: ${{ steps.check-tag.outputs.tag }}
body: |
Changelog
Expand All @@ -72,7 +88,9 @@ jobs:
draft: true
prerelease: false

- name: Upload Release Asset
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.check-tag.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ runner.os }}.tar.bz2
run: |
gh release upload ${{ steps.check-tag.outputs.tag }}-mac ${{ env.ZIP_NAME }}-mac-x64.tar.bz2
gh release upload ${{ steps.check-tag.outputs.tag }}-mac ${{ env.ZIP_NAME }}-mac-x64-upx.tar.bz2
35 changes: 27 additions & 8 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:

- uses: actions/checkout@v3

- name: Check wxWidget version
- name: Check wxWidgets version
id: wx-version
run: |
VERSION=$(cat WX_VERSION.txt)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
shell: bash

- name: Cache wxWidget
- name: Cache wxWidgets
uses: actions/cache@v3
id: cache-wx
with:
Expand All @@ -42,7 +42,7 @@ jobs:
run: |
sudo apt -y install libgtk-3-dev
- name: build wxWidget
- name: build wxWidgets
if: steps.cache-wx.outputs.cache-hit != 'true'
run: |
cd shell_scripts
Expand All @@ -53,21 +53,38 @@ jobs:
run: |
bash shell_scripts/build_exe.sh
- name: copy files
- name: Archive Release
run: |
mkdir -p archive/${{ env.ZIP_NAME }}
cp build/Release/SimpleCommandRunner archive/${{ env.ZIP_NAME }}
cp examples/other_features/help/gui_definition.json archive/${{ env.ZIP_NAME }}
cp changelog.txt archive/${{ env.ZIP_NAME }}
cp license.txt archive/${{ env.ZIP_NAME }}
cd archive
tar -jcvf ${{ env.ZIP_NAME }}-${{ runner.os }}.tar.bz2 ${{ env.ZIP_NAME }}
tar -jcvf ${{ env.ZIP_NAME }}-ubu-x64.tar.bz2 ${{ env.ZIP_NAME }}
mv ${{ env.ZIP_NAME }}-ubu-x64.tar.bz2 ../
- name: Install UPX
uses: crazy-max/ghaction-upx@v2
with:
install-only: true

- name: Run UPX
run: |
cd archive/${{ env.ZIP_NAME }}
upx SimpleCommandRunner --best
- name: Archive UPX Release
run: |
cd archive
tar -jcvf ${{ env.ZIP_NAME }}-ubu-x64-upx.tar.bz2 ${{ env.ZIP_NAME }}
mv ${{ env.ZIP_NAME }}-ubu-x64-upx.tar.bz2 ../
- name: Create Release Draft
id: create-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.check-tag.outputs.tag }}
tag_name: ${{ steps.check-tag.outputs.tag }}-ubu
name: ${{ steps.check-tag.outputs.tag }}
body: |
Changelog
Expand All @@ -76,7 +93,9 @@ jobs:
draft: true
prerelease: false

- name: Upload Release Asset
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.check-tag.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ runner.os }}.tar.bz2
run: |
gh release upload ${{ steps.check-tag.outputs.tag }}-ubu ${{ env.ZIP_NAME }}-ubu-x64.tar.bz2
gh release upload ${{ steps.check-tag.outputs.tag }}-ubu ${{ env.ZIP_NAME }}-ubu-x64-upx.tar.bz2
37 changes: 31 additions & 6 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ jobs:

- uses: actions/checkout@v3

- name: Check wxWidget version
- name: Check wxWidgets version
id: wx-version
run: |
VERSION=$(cat WX_VERSION.txt)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
shell: bash

- name: Cache wxWidget
- name: Cache wxWidgets
uses: actions/cache@v3
id: cache-wx
with:
path: "~/wxWidgets-${{ steps.wx-version.outputs.version }}"
key: ${{ runner.os }}-wx${{ steps.wx-version.outputs.version }}

- name: install wxWidget
- name: install wxWidgets
if: steps.cache-wx.outputs.cache-hit != 'true'
run: |
cd batch_files
Expand All @@ -64,13 +64,36 @@ jobs:
with:
directory: 'archive'
type: 'zip'
filename: '${{ env.ZIP_NAME }}-${{ runner.os }}.zip'
filename: '${{ env.ZIP_NAME }}-win-x64.zip'

- name: Run UPX
uses: crazy-max/ghaction-upx@v2
with:
version: latest
files: |
./archive/SimpleCommandRunner.exe
args: --best

- name: Copy files
run: mv archive/${{ env.ZIP_NAME }}-win-x64.zip ./
shell: bash

- name: Archive Release
uses: thedoctor0/zip-release@master
with:
directory: 'archive'
type: 'zip'
filename: '${{ env.ZIP_NAME }}-win-x64-upx.zip'

- name: Copy files
run: mv archive/${{ env.ZIP_NAME }}-win-x64-upx.zip ./
shell: bash

- name: Create Release Draft
id: create-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.check-tag.outputs.tag }}
tag_name: ${{ steps.check-tag.outputs.tag }}-win
name: ${{ steps.check-tag.outputs.tag }}
body: |
Changelog
Expand All @@ -82,4 +105,6 @@ jobs:
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.check-tag.outputs.tag }} archive/${{ env.ZIP_NAME }}-${{ runner.os }}.zip
run: |
gh release upload ${{ steps.check-tag.outputs.tag }}-win ${{ env.ZIP_NAME }}-win-x64.zip
gh release upload ${{ steps.check-tag.outputs.tag }}-win ${{ env.ZIP_NAME }}-win-x64-upx.zip
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: test

on:
push:
tags:
- "v*"
workflow_dispatch:

env:
Expand Down
Loading

0 comments on commit 9f882d4

Please sign in to comment.