From bdccb866fed255fc872a2e2be7dcfcb2c24fae58 Mon Sep 17 00:00:00 2001 From: Vladislav Yaroslavlev Date: Tue, 17 Feb 2026 17:59:59 +0300 Subject: [PATCH 1/3] git action for build binaries --- .github/workflows/release.yml | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 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..880ae44 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,91 @@ +name: Release + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' # Matches tags like 3.0.0, 3.1.2, etc. + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: Build ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + artifact_name: telemt + asset_name: telemt-x86_64-linux + - target: aarch64-unknown-linux-gnu + artifact_name: telemt + asset_name: telemt-aarch64-linux + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install stable Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Install cross-compilation tools + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + + - name: Cache cargo registry & build artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.target }}-cargo- + + - name: Build Release + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --release --target ${{ matrix.target }} + + - name: Package binary + run: | + cd target/${{ matrix.target }}/release + tar -czvf ${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }} + sha256sum ${{ matrix.asset_name }}.tar.gz > ${{ matrix.asset_name }}.sha256 + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.asset_name }} + path: | + target/${{ matrix.target }}/release/${{ matrix.asset_name }}.tar.gz + target/${{ matrix.target }}/release/${{ matrix.asset_name }}.sha256 + + release: + name: Create Release + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + files: artifacts/**/* + generate_release_notes: true + draft: false + prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }} From 3206ce50bb48c466a69d9b6096e7975a257e4d72 Mon Sep 17 00:00:00 2001 From: Vladislav Yaroslavlev Date: Tue, 17 Feb 2026 18:17:14 +0300 Subject: [PATCH 2/3] add manual workflow run --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 880ae44..cacafc5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' # Matches tags like 3.0.0, 3.1.2, etc. + workflow_dispatch: # Manual trigger from GitHub Actions UI env: CARGO_TERM_COLOR: always From 0057377ac603e5f6d5d8c483307df812742af8f7 Mon Sep 17 00:00:00 2001 From: Vladislav Yaroslavlev Date: Wed, 18 Feb 2026 11:38:20 +0300 Subject: [PATCH 3/3] Fix CodeQL warnings: add permissions and pin action versions --- .github/workflows/release.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cacafc5..05e334a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,9 @@ on: - '[0-9]+.[0-9]+.[0-9]+' # Matches tags like 3.0.0, 3.1.2, etc. workflow_dispatch: # Manual trigger from GitHub Actions UI +permissions: + contents: read + env: CARGO_TERM_COLOR: always @@ -13,6 +16,9 @@ jobs: build: name: Build ${{ matrix.target }} runs-on: ubuntu-latest + permissions: + contents: read + strategy: fail-fast: false matrix: @@ -26,11 +32,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install stable Rust toolchain - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@888c2e1ea69ab0d4330cbf0af1ecc7b68f368cc1 # v1 with: + toolchain: stable targets: ${{ matrix.target }} - name: Install cross-compilation tools @@ -39,7 +46,7 @@ jobs: sudo apt-get install -y gcc-aarch64-linux-gnu - name: Cache cargo registry & build artifacts - uses: actions/cache@v4 + uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 with: path: | ~/.cargo/registry @@ -50,7 +57,7 @@ jobs: ${{ runner.os }}-${{ matrix.target }}-cargo- - name: Build Release - uses: actions-rs/cargo@v1 + uses: actions-rs/cargo@ae10961054e4aa8bff448f48a500763b90d5c550 # v1.0.1 with: use-cross: true command: build @@ -63,7 +70,7 @@ jobs: sha256sum ${{ matrix.asset_name }}.tar.gz > ${{ matrix.asset_name }}.sha256 - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: ${{ matrix.asset_name }} path: | @@ -79,12 +86,12 @@ jobs: steps: - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: path: artifacts - name: Create Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@c95fe1489396fe360a41fb53f90de6ddce8c4c8a # v2.2.1 with: files: artifacts/**/* generate_release_notes: true