From a353916f3a9ba85197131ee8a80f940cab3d944f Mon Sep 17 00:00:00 2001 From: Filip Bozic <70634661+fbozic@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:39:31 +0200 Subject: [PATCH] ci: setup github app token generation --- .github/workflows/release.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d22f71a..486fb4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,12 +13,21 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Generate GitHub token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.ACTIONS_APP_ID }} + private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} + - name: Get version id: get_version run: echo "version=$(cargo read-manifest | jq -r '.version')" >> $GITHUB_OUTPUT - name: Check if release exists id: check_release + env: + GITHUB_OUTPUT: ${{ steps.generate-token.outputs.token }} run: | RELEASE_URL=$(curl --silent "https://api.github.com/repos/calimero-network/relay-server/releases/tags/${{ steps.get_version.outputs.version }}" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ @@ -34,11 +43,8 @@ jobs: if: steps.check_release.outputs.exists == 'false' - name: Build for Intel Linux - uses: actions-rs/cargo@v1 + run: cargo build --release --target=x86_64-unknown-linux-gnu if: steps.check_release.outputs.exists == 'false' - with: - command: build - args: --release --target=x86_64-unknown-linux-gnu - name: Build for ARM Linux run: cross build --release --target=armv7-unknown-linux-gnueabihf @@ -53,4 +59,4 @@ jobs: target/x86_64-unknown-linux-gnu/release/relay-server target/armv7-unknown-linux-gnueabihf/release/relay-server env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_OUTPUT: ${{ steps.generate-token.outputs.token }}