name: Build aether-proxy on: push: tags: ['proxy-v*'] workflow_dispatch: permissions: contents: write jobs: build: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - name: linux-amd64 target: x86_64-unknown-linux-gnu os: ubuntu-latest use_cross: true - name: linux-arm64 target: aarch64-unknown-linux-gnu os: ubuntu-latest use_cross: true - name: linux-musl-amd64 target: x86_64-unknown-linux-musl os: ubuntu-latest use_cross: true - name: linux-musl-arm64 target: aarch64-unknown-linux-musl os: ubuntu-latest use_cross: true - name: macos-amd64 target: x86_64-apple-darwin os: macos-15-intel use_cross: false - name: macos-arm64 target: aarch64-apple-darwin os: macos-15 use_cross: false - name: windows-amd64 target: x86_64-pc-windows-msvc os: windows-latest use_cross: false steps: - uses: actions/checkout@v5 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - name: Ensure Rust target is installed run: rustup target add ${{ matrix.target }} - name: Rust cache uses: Swatinem/rust-cache@v2 with: workspaces: apps/aether-proxy -> target key: ${{ matrix.target }} - name: Install cross if: matrix.use_cross uses: taiki-e/install-action@cross - name: Build working-directory: apps/aether-proxy shell: bash run: | if [ "${{ matrix.use_cross }}" = "true" ]; then cross build --release --target ${{ matrix.target }} else cargo build --release --target ${{ matrix.target }} fi - name: Package (Unix) if: runner.os != 'Windows' shell: bash run: | cd target/${{ matrix.target }}/release chmod +x aether-proxy tar czf ../../../aether-proxy-${{ matrix.name }}.tar.gz aether-proxy - name: Package (Windows) if: runner.os == 'Windows' shell: bash run: | cd target/${{ matrix.target }}/release 7z a ../../../aether-proxy-${{ matrix.name }}.zip aether-proxy.exe - name: Upload artifact uses: actions/upload-artifact@v5 with: name: aether-proxy-${{ matrix.name }} path: | aether-proxy-*.tar.gz aether-proxy-*.zip if-no-files-found: error release: needs: build runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - name: Download all artifacts uses: actions/download-artifact@v5 with: merge-multiple: true path: artifacts - name: Generate checksums working-directory: artifacts run: sha256sum aether-proxy-* > SHA256SUMS.txt - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: name: "${{ github.ref_name }}" generate_release_notes: true files: | artifacts/aether-proxy-* artifacts/SHA256SUMS.txt fail_on_unmatched_files: true update-readme: needs: release runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/checkout@v5 with: ref: aether-rust-pioneer - name: Update README download links env: TAG: ${{ github.ref_name }} run: | VERSION="${TAG#proxy-v}" BASE="https://github.com/fawney19/Aether/releases/download/${TAG}" if [ -d apps/aether-proxy ]; then PROXY_DIR="apps/aether-proxy" else PROXY_DIR="aether-proxy" fi cd "$PROXY_DIR" TABLE="| Platform | Download |\n|----------|----------|\n" TABLE+="| Linux x86_64 (GNU) | [aether-proxy-linux-amd64.tar.gz](${BASE}/aether-proxy-linux-amd64.tar.gz) |\n" TABLE+="| Linux ARM64 (GNU) | [aether-proxy-linux-arm64.tar.gz](${BASE}/aether-proxy-linux-arm64.tar.gz) |\n" TABLE+="| Linux x86_64 (musl) | [aether-proxy-linux-musl-amd64.tar.gz](${BASE}/aether-proxy-linux-musl-amd64.tar.gz) |\n" TABLE+="| Linux ARM64 (musl) | [aether-proxy-linux-musl-arm64.tar.gz](${BASE}/aether-proxy-linux-musl-arm64.tar.gz) |\n" TABLE+="| macOS x86_64 | [aether-proxy-macos-amd64.tar.gz](${BASE}/aether-proxy-macos-amd64.tar.gz) |\n" TABLE+="| macOS ARM64 | [aether-proxy-macos-arm64.tar.gz](${BASE}/aether-proxy-macos-arm64.tar.gz) |\n" TABLE+="| Windows x86_64 | [aether-proxy-windows-amd64.zip](${BASE}/aether-proxy-windows-amd64.zip) |" # Replace content between markers if grep -q '' README.md; then awk -v table="$TABLE" ' // { print; printf "%s\n", table; skip=1; next } // { skip=0 } !skip { print } ' README.md > README.tmp && mv README.tmp README.md fi - name: Commit and push run: | if [ -d apps/aether-proxy ]; then PROXY_DIR="apps/aether-proxy" else PROXY_DIR="aether-proxy" fi cd "$PROXY_DIR" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add README.md git diff --cached --quiet && exit 0 TAG="${GITHUB_REF#refs/tags/}" git commit -m "chore(proxy): update download links for ${TAG}" git push