From ec00ed8d00abc31719201d631bff6f56d226befc Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 21 Dec 2025 12:49:05 +0000 Subject: [PATCH] Add GitHub Actions workflow for automated releases This commit introduces a new GitHub Actions workflow located at `.github/workflows/release.yml`. The workflow is triggered on push of tags starting with `v*` and performs the following actions: - Builds release binaries for Linux (ubuntu-latest), Windows (windows-latest), and macOS (macos-latest). - Packages the binaries into `.tar.gz` (Unix) or `.zip` (Windows) archives. - Uploads the packaged assets to the GitHub Release associated with the tag using `softprops/action-gh-release`. This automates the process of generating and distributing release-ready binaries for multiple platforms. --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fdbfa1d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + build-and-release: + name: Build and Release + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + artifact_name: lanshare + asset_name: lanshare-linux-amd64 + - os: windows-latest + artifact_name: lanshare.exe + asset_name: lanshare-windows-amd64 + - os: macos-latest + artifact_name: lanshare + asset_name: lanshare-macos-amd64 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build + run: cargo build --release --locked --verbose + + - name: Package (Unix) + if: runner.os != 'Windows' + run: | + tar -czf ${{ matrix.asset_name }}.tar.gz -C target/release ${{ matrix.artifact_name }} + + - name: Package (Windows) + if: runner.os == 'Windows' + run: | + Compress-Archive -Path target/release/${{ matrix.artifact_name }} -DestinationPath ${{ matrix.asset_name }}.zip + + - name: Upload Release Asset + uses: softprops/action-gh-release@v2 + with: + files: ${{ matrix.asset_name }}.*