From e2c7ce6b2bbab679da73e752f0e5e63218f56096 Mon Sep 17 00:00:00 2001 From: danielvici123 <94993276+danielvici@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:27:21 +0200 Subject: [PATCH] ci: add Gitea Actions workflow for multi-platform releases --- .gitea/workflows/release.yaml | 97 +++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..66c031e --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,97 @@ +name: Build and Release + +on: + push: + tags: + - 'v*' + +jobs: + build-linux: + name: Build Linux + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions/setup-rust@v1 + with: + rust-version: stable + + - name: Build + run: cargo build --release + + - name: Package Linux + run: | + mkdir -p dist-linux + cp target/release/dhl dist-linux/dhl + cp config.json.example dist-linux/config.json + cp response.json.example dist-linux/response.json + tar -czvf dhl-linux.tar.gz -C dist-linux . + + - name: Upload Linux Artifact + uses: actions/upload-artifact@v4 + with: + name: dhl-linux + path: dhl-linux.tar.gz + + build-windows: + name: Build Windows + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions/setup-rust@v1 + with: + rust-version: stable + + - name: Build + run: cargo build --release + + - name: Package Windows + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path dist-windows + Copy-Item target/release/dhl.exe dist-windows/dhl.exe + Copy-Item config.json.example dist-windows/config.json + Copy-Item response.json.example dist-windows/response.json + Compress-Archive -Path dist-windows/* -DestinationPath dhl-windows.zip + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v4 + with: + name: dhl-windows + path: dhl-windows.zip + + create-release: + name: Create Release + needs: [build-linux, build-windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download Linux Artifact + uses: actions/download-artifact@v4 + with: + name: dhl-linux + path: . + + - name: Download Windows Artifact + uses: actions/download-artifact@v4 + with: + name: dhl-windows + path: . + + - name: Create Gitea Release + uses: softprops/action-gh-release@v2 + with: + files: | + dhl-linux.tar.gz + dhl-windows.zip + generate_release_notes: true + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}