From 19b027b527a84fc0aa97cecf26b1d0c93abac820 Mon Sep 17 00:00:00 2001 From: arabian Date: Sun, 5 Apr 2026 00:13:23 +0300 Subject: [PATCH] add github workflow for dev release --- src/sources/dev-release.yml | 113 ++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 src/sources/dev-release.yml diff --git a/src/sources/dev-release.yml b/src/sources/dev-release.yml new file mode 100644 index 0000000..611ce26 --- /dev/null +++ b/src/sources/dev-release.yml @@ -0,0 +1,113 @@ +name: Development Release + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + build: + name: Build for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + artifact_name: lyrics_fetcher-linux-amd64 + binary_name: lyrics_fetcher + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + artifact_name: lyrics_fetcher-linux-arm64 + binary_name: lyrics_fetcher + - os: windows-latest + target: x86_64-pc-windows-msvc + artifact_name: lyrics_fetcher-windows-amd64.exe + binary_name: lyrics_fetcher.exe + - os: windows-latest + target: aarch64-pc-windows-msvc + artifact_name: lyrics_fetcher-windows-arm64.exe + binary_name: lyrics_fetcher.exe + - os: macos-latest + target: x86_64-apple-darwin + artifact_name: lyrics_fetcher-macos-amd64 + binary_name: lyrics_fetcher + - os: macos-latest + target: aarch64-apple-darwin + artifact_name: lyrics_fetcher-macos-aarch64 + binary_name: lyrics_fetcher + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} + + - name: Install cross-compiler for Linux ARM64 + if: matrix.target == 'aarch64-unknown-linux-gnu' + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV + + - name: Build binary + run: cargo build --release --target ${{ matrix.target }} + + - name: Rename artifact + shell: bash + run: | + mv target/${{ matrix.target }}/release/${{ matrix.binary_name }} target/${{ matrix.target }}/release/${{ matrix.artifact_name }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact_name }} + path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} + retention-days: 1 + + release: + name: Update Development Release + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + merge-multiple: true + + - name: Generate release info + id: release_info + run: | + echo "date=$(date +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_OUTPUT + echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Publish Development Release + uses: softprops/action-gh-release@v2 + with: + tag_name: development + target_commitish: ${{ github.sha }} + name: "Development Build" + body: | + Автоматическая сборка последней версии для тестирования. + + **Commit:** [${{ steps.release_info.outputs.commit }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) + **Date:** ${{ steps.release_info.outputs.date }} + prerelease: true + files: artifacts/*