Skip to content

Commit

Permalink
update with new filename and workflow trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
momentmaker committed Aug 8, 2024
1 parent 6d91f10 commit 8765e27
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/actions/goreleaser-build-sign-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inputs:
required: false
docker-image-name:
description: The docker image name
default: chainlink-develop
default: chainlink
required: false
docker-image-tag:
description: The docker image tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,39 @@ name: "Build and Publish Chainlink"

on:
pull_request:
branches-ignore:
- 'release/**'
push:
branches:
- develop
workflow_dispatch:
inputs:
git_ref:
description: "Git ref (commit SHA, branch name, tag name, etc.) to checkout"
required: true

env:
GIT_REF: ${{ github.event.inputs.git_ref || github.ref }}

jobs:
validate-git-ref:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Validate GIT_REF
if: ${{ github.event.inputs.git_ref }}
run: |
if ! git rev-parse --verify "${{ env.GIT_REF }}" > /dev/null 2>&1; then
echo "Invalid GIT_REF: ${{ env.GIT_REF }}"
exit 1
fi
goreleaser-build-publish-chainlink:
needs: [validate-git-ref]
runs-on:
labels: ubuntu22.04-16cores-64GB
environment: build-develop
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ env.GIT_REF }}

- name: Get image tag
id: get-image-tag
run: |
short_sha=$(git rev-parse --short HEAD)
if [[ ${{ github.event }} == 'pull_request' ]]; then
if [[ ${{ github.head_ref }} == 'release/'* ]]; then
echo "image-tag=release-${short_sha}" >> $GITHUB_OUTPUT
else
echo "image-tag=pr-${{ github.event.number }}-${short_sha}" >> $GITHUB_OUTPUT
fi
else
echo "image-tag=develop-${short_sha}" >> $GITHUB_OUTPUT
fi
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }}
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }}
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true
Expand All @@ -61,6 +47,7 @@ jobs:
enable-docker-publish: "true"
docker-registry: ${{ secrets.AWS_DEVELOP_ECR_HOSTNAME }}
docker-image-name: chainlink
docker-image-tag: ${{ steps.get-image-tag.outputs.image-tag }}
enable-goreleaser-snapshot: "true"
goreleaser-exec: ./tools/bin/goreleaser_wrapper
goreleaser-config: .goreleaser.develop.yaml
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.develop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project_name: chainlink
env:
- ZIG_EXEC={{ if index .Env "ZIG_EXEC" }}{{ .Env.ZIG_EXEC }}{{ else }}zig{{ end }}
- IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}localhost:5001{{ end }}
- IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}chainlink-develop{{ end }}
- IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}chainlink{{ end }}
- IMAGE_TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}develop{{ end }}
- IMAGE_LABEL_DESCRIPTION="node of the decentralized oracle network, bridging on and off-chain computation"
- IMAGE_LABEL_LICENSES="MIT"
Expand Down

0 comments on commit 8765e27

Please sign in to comment.