From de31838195f2c8cb92db99b5a730c4892d8852c6 Mon Sep 17 00:00:00 2001 From: ethanaobrien Date: Sun, 8 Dec 2024 17:25:49 -0600 Subject: [PATCH] Add build release workflow --- .forgejo/workflows/release.yml | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .forgejo/workflows/release.yml diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..bb0acb2 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,56 @@ +name: Build release binaries + +on: + push: + tags: 'v*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checking out branch + uses: actions/checkout@v3 + + - name: Install Rust + shell: bash + run: curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain stable --profile minimal + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Create out directory + run: | + mkdir out + + - name: Build webui + run: | + cd webui + npm install + npm run build + + - name: Build x86_64-unknown-linux-gnu + run: | + . "$HOME/.cargo/env" + cargo build --target x86_64-unknown-linux-gnu --release || echo "Failed to build" + mv target/x86_64-unknown-linux-gnu/release/ew out/ew-x86_64-unknown-linux-gnu + + - name: Build x86_64-pc-windows-gnu + run: | + . "$HOME/.cargo/env" + sudo apt update && sudo apt install gcc-mingw-w64 -y + rustup target add x86_64-pc-windows-gnu + cargo build --target x86_64-pc-windows-gnu --release || echo "Failed to build" + mv target/x86_64-pc-windows-gnu/release/ew.exe out/ew-x86_64-pc-windows-gnu.exe + + - name: Publish release + uses: actions/forgejo-release@v2 + with: + direction: upload + release-dir: ./out/ + release-notes-assistant: true + tag: "${{ github.ref_name }}" + sha: "${{ github.sha }}" + title: "Release ${{ github.ref_name }}" + token: ${{ github.token }}