diff --git a/.github/workflows/avail.yml b/.github/workflows/avail.yml index 316279e..969ef0f 100644 --- a/.github/workflows/avail.yml +++ b/.github/workflows/avail.yml @@ -11,8 +11,6 @@ on: - .github/workflows/avail.yml - config.yml -env: - RELEASE_REF: refs/heads/main jobs: build-binaries: runs-on: ubuntu-latest @@ -28,7 +26,7 @@ jobs: fail-fast: false matrix: debian-versions: [bookworm] - rust-versions: [1.78.0] + rust-versions: [1.81.0] clang-versions: [17] rustc-targets: ["x86-64-v2", "x86-64-v3"] steps: @@ -36,9 +34,10 @@ jobs: uses: actions/checkout@v4 - name: Set environmental variables run: | - echo "CODE_GIT_REPO=$(cat config.yml | yq -r '.avail.git_repo' | tr -d '\n')" >> "$GITHUB_ENV" - CODE_GIT_REF=$(cat config.yml | yq -r '.avail.git_ref' | tr -d '\n') + echo "CODE_GIT_REPO=$(cat config.yml | yq -r '.avail.code_git_repo' | tr -d '\n')" >> "$GITHUB_ENV" + CODE_GIT_REF=$(cat config.yml | yq -r '.avail.code_git_ref' | tr -d '\n') echo "CODE_GIT_REF=${CODE_GIT_REF}" >> $GITHUB_ENV + echo "PUSH_GIT_REF=$(cat config.yml | yq -r '.avail.push_git_ref' | tr -d '\n')" >> "$GITHUB_ENV" ENV_VERSION="debian-${{ matrix.debian-versions }}-rust-${{ matrix.rust-versions }}-clang-${{ matrix.clang-versions }}-${{ matrix.rustc-targets }}" echo "BINARY_FILE_NAME=${CODE_GIT_REF}-${ENV_VERSION}" >> $GITHUB_ENV echo "EXECUTE_WORKER_BINARY_FILE_NAME=${CODE_GIT_REF}-execute-worker-${ENV_VERSION}" >> $GITHUB_ENV @@ -56,7 +55,7 @@ jobs: cargo build --release --locked --target x86_64-unknown-linux-gnu ls /opt/cargo_target/x86_64-unknown-linux-gnu/release - name: "Create release" - if: ${{ github.ref == env.RELEASE_REF }} + if: ${{ github.ref == env.PUSH_GIT_REF }} uses: "actions/github-script@v6" with: script: | @@ -74,7 +73,7 @@ jobs: core.notice(error.message); } - name: Upload binaries - if: ${{ github.ref == env.RELEASE_REF }} + if: ${{ github.ref == env.PUSH_GIT_REF }} run: | BINARIES_DIR=${CARGO_TARGET_DIR}/x86_64-unknown-linux-gnu/release mv ${BINARIES_DIR}/avail-node ${BINARIES_DIR}/avail-${BINARY_FILE_NAME} diff --git a/.github/workflows/polkadot.yml b/.github/workflows/polkadot.yml index 57e9ebd..fe0eb7d 100644 --- a/.github/workflows/polkadot.yml +++ b/.github/workflows/polkadot.yml @@ -17,7 +17,6 @@ on: env: REGISTRY: ghcr.io - RELEASE_REF: refs/heads/main jobs: build-docker-images: runs-on: ubuntu-latest @@ -42,8 +41,9 @@ jobs: run: | echo "ENV_FULL_IMAGE_NAME=${{ env.REGISTRY }}/${{ env.ENV_IMAGE_NAME }}:debian-${{ matrix.debian-versions }}-rust-${{ matrix.rust-versions }}-clang-${{ matrix.clang-versions }}" >> "$GITHUB_ENV" echo "image-name=${{ env.REGISTRY }}/${{ env.ENV_IMAGE_NAME }}" >> "$GITHUB_OUTPUT" - echo "CODE_GIT_REPO=$(cat config.yml | yq -r '.polkadot.git_repo' | tr -d '\n')" >> "$GITHUB_ENV" - echo "CODE_GIT_REF=$(cat config.yml | yq -r '.polkadot.git_ref' | tr -d '\n')" >> "$GITHUB_ENV" + echo "CODE_GIT_REPO=$(cat config.yml | yq -r '.polkadot.code_git_repo' | tr -d '\n')" >> "$GITHUB_ENV" + echo "CODE_GIT_REF=$(cat config.yml | yq -r '.polkadot.code_git_ref' | tr -d '\n')" >> "$GITHUB_ENV" + echo "PUSH_GIT_REF=$(cat config.yml | yq -r '.polkadot.push_git_ref' | tr -d '\n')" >> "$GITHUB_ENV" - name: Check Docker image run: | if docker manifest inspect "${ENV_FULL_IMAGE_NAME}" > /dev/null 2>&1; then @@ -103,7 +103,7 @@ jobs: GIT_REF=${{ env.CODE_GIT_REF }} tags: test-build-image - name: Push Docker image - if: ${{ env.CONTINUE_IMAGE_BUILD == 'true' && github.ref == env.RELEASE_REF }} + if: ${{ env.CONTINUE_IMAGE_BUILD == 'true' && github.ref == env.PUSH_GIT_REF }} run: docker push ${{ env.ENV_FULL_IMAGE_NAME }} build-binaries: runs-on: ubuntu-latest @@ -126,11 +126,12 @@ jobs: uses: actions/checkout@v4 - name: Set environmental variables run: | - echo "CODE_GIT_REPO=$(cat config.yml | yq -r '.polkadot.git_repo' | tr -d '\n')" >> "$GITHUB_ENV" - CODE_GIT_REF=$(cat config.yml | yq -r '.polkadot.git_ref' | tr -d '\n') + echo "CODE_GIT_REPO=$(cat config.yml | yq -r '.polkadot.code_git_repo' | tr -d '\n')" >> "$GITHUB_ENV" + CODE_GIT_REF=$(cat config.yml | yq -r '.polkadot.code_git_ref' | tr -d '\n') echo "CODE_GIT_REF=${CODE_GIT_REF}" >> $GITHUB_ENV IMAGE_NAME=$(cat config.yml | yq -r '.polkadot.image_name' | tr -d '\n') echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV + echo "PUSH_GIT_REF=$(cat config.yml | yq -r '.polkadot.push_git_ref' | tr -d '\n')" >> "$GITHUB_ENV" BUILD_VERSION="debian-${{ matrix.debian-versions }}-rust-${{ matrix.rust-versions }}-clang-${{ matrix.clang-versions }}-${{ matrix.rustc-targets }}" echo "BINARY_FILE_NAME=${CODE_GIT_REF}-${BUILD_VERSION}" >> $GITHUB_ENV echo "EXECUTE_WORKER_BINARY_FILE_NAME=${CODE_GIT_REF}-execute-worker-${BUILD_VERSION}" >> $GITHUB_ENV @@ -158,7 +159,7 @@ jobs: cp ${BINARIES_DIR}/polkadot-execute-worker ${GITHUB_WORKSPACE}/artifacts cp ${BINARIES_DIR}/polkadot-prepare-worker ${GITHUB_WORKSPACE}/artifacts - name: Create GitHub release - if: ${{ github.ref == env.RELEASE_REF }} + if: ${{ github.ref == env.PUSH_GIT_REF }} uses: "actions/github-script@v6" with: script: | @@ -176,7 +177,7 @@ jobs: core.notice(error.message); } - name: Upload binaries to GitHub release - if: ${{ github.ref == env.RELEASE_REF }} + if: ${{ github.ref == env.PUSH_GIT_REF }} env: GH_TOKEN: ${{ github.token }} run: | @@ -203,7 +204,7 @@ jobs: with: file: dockerfiles/Dockerfile-amd64 context: artifacts - push: ${{ github.ref == env.RELEASE_REF }} + push: ${{ github.ref == env.PUSH_GIT_REF }} load: true labels: ${{ steps.meta.outputs.labels }} build-args: |