WindSend Release #22
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
name: WindSend Release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: aarch64-unknown-linux-gnu | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Install dependencies on Ubuntu | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libxdo-dev libappindicator3-dev | |
sudo apt-get install -y pkg-config libssl-dev build-essential linux-libc-dev | |
sudo apt-get install -y musl-dev musl-tools | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- run: | | |
flutter --version | |
flutter doctor | |
- name: Run Build Script | |
env: | |
CI_RUNNING: true # for build script | |
working-directory: ./ | |
run: | | |
chmod +x ./*.sh | |
./build_linux.sh | |
./build_android.sh | |
# generate test zip file | |
# run: | | |
# mkdir -p ./bin | |
# echo "Hello, World!" > ./bin/test.txt | |
# zip -r ./bin/test.zip ./bin/test.txt | |
# echo "Hello, World!" > ./bin/test.apk | |
- name: Archive artifacts | |
id: build_archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WindSend-Archives-linux | |
path: | | |
./bin/*.zip | |
./bin/*.apk | |
if-no-files-found: error | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: aarch64-pc-windows-msvc | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Install NASM | |
uses: ilammy/setup-nasm@v1 | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- run: | | |
flutter --version | |
flutter doctor | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
path-type: "inherit" | |
install: >- | |
zip | |
- name: Run Build Script | |
shell: msys2 {0} | |
env: | |
CI_RUNNING: true # for build script | |
working-directory: ./ | |
run: | | |
./build_windows.sh | |
- name: Archive artifacts | |
id: build_archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WindSend-Archives-windows | |
path: | | |
./bin/*.zip | |
./bin/*.apk | |
if-no-files-found: error | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: aarch64-apple-darwin | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Print Flutter Info | |
run: | | |
flutter --version | |
- name: Run Build Script | |
env: | |
CI_RUNNING: true # for build script | |
working-directory: ./ | |
run: | | |
chmod +x ./*.sh | |
./build_macos.sh | |
- name: Archive artifacts | |
id: build_archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WindSend-Archives-macos | |
path: | | |
./bin/*.zip | |
if-no-files-found: error | |
release: | |
needs: [build-linux, build-windows, build-macos] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
# name: WindSend-Archives-linux | |
path: ./Downloaded-Archives | |
merge-multiple: true | |
- name: Echo env | |
run: | | |
echo 'ref ${{ github.ref }}' | |
echo 'ref name ${{ github.ref_name }}' | |
echo 'sha ${{ github.sha }}' | |
echo 'actor ${{ github.actor }}' | |
echo 'repository ${{ github.repository }}' | |
echo 'repository_owner ${{ github.repository_owner }}' | |
echo 'event_name ${{ github.event_name }}' | |
echo 'event_path ${{ github.event_path }}' | |
echo 'workspace ${{ github.workspace }}' | |
echo 'action ${{ github.action }}' | |
echo 'job ${{ github.job }}' | |
echo 'run_id ${{ github.run_id }}' | |
echo 'run_number ${{ github.run_number }}' | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
# if: startsWith(github.ref, 'refs/tags/') # e.g. refs/tags/v1.0.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
./Downloaded-Archives/*.zip | |
./Downloaded-Archives/*.apk | |
draft: true |