Github Action for auto release
Is there a github action that can automatically build dioxus-desktop and publish it to github release.
Mainly download dx and configure some dependent libraries.
I encountered some env problems.
For example, on Ubuntu:
https://github.com/oovm/lpk-unpack/actions/runs/14168809778/job/39687835235
pkg-config exited with status code 1
> PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags glib-2.0 'glib-2.0 >= 2.70'
The system library `glib-2.0` required by crate `glib-sys` was not found.
The file `glib-2.0.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
The PKG_CONFIG_PATH environment variable is not set.
HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `glib-2.0.pc`.
warning: build failed, waiting for other jobs to finish...
warning: [email protected]:
error: failed to run custom build command for `gobject-sys v0.18.0`
For example, on MacOS:
https://github.com/oovm/lpk-unpack/actions/runs/14170378069/job/39692636808
dyld[1649]: Library not loaded: /usr/local/opt/openssl@3/lib/libssl.3.dylib
Referenced from: <5FDA7287-635F-303C-B[9](https://github.com/oovm/lpk-unpack/actions/runs/14170378069/job/39692636808#step:5:10)4B-EF915E0DAF0D> /Users/runner/work/lpk-unpack/lpk-unpack/dx
Reason: tried: '/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file)
/Users/runner/work/_temp/a86abd[10](https://github.com/oovm/lpk-unpack/actions/runs/14170378069/job/39692636808#step:5:11)-fde5-4b8c-ae4c-50159d031adb.sh: line 5: 1649 Abort trap: 6 ./dx build --package lpk-unpack --platform desktop --release
Error: Process completed with exit code 134.
It would be best if there is an action to complete the following tasks
-
vars
- assets_name: string
- packages: string?
-
actions
- Download
dx, add to PATH, and provide executable files - Read the variable packages, and you can also not read it if it is not a workspace, and use dx to build
- Package the product as 7z, read the variable assets_name, and rename it
- Create a new github tag and upload it to github release
I use the following script, but I don't have the energy to adapt it for each platform
- name: Download Dioxus CLI
shell: bash
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
curl -L -o dx.zip https://github.com/DioxusLabs/dioxus/releases/download/v0.6.3/dx-x86_64-pc-windows-msvc-v0.6.3.zip
unzip dx.zip
else
curl -L -o dx.tar.gz https://github.com/DioxusLabs/dioxus/releases/download/v0.6.3/dx-x86_64-apple-darwin-v0.6.3.tar.gz
tar xzf dx.tar.gz
chmod +x dx
fi
- name: Build with Dioxus CLI
shell: bash
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
./dx.exe build --package lpk-unpack --platform desktop --release
else
./dx build --package lpk-unpack --platform desktop --release
fi
- name: Package Release
shell: bash
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cd dist/windows-latest/release
7z a ../../${{ matrix.asset_name }} .
else
cd dist/macos-latest/release
7z a ../../${{ matrix.asset_name }} .
fi
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/${{ matrix.asset_name }}.*
I haven't updated it in a while, but I made a nightly build CI for dioxus builds in floneum a while ago that might be useful as a starting point: https://github.com/floneum/floneum/blob/main/.github/workflows/nightly.yml