Skip to content

Commit

Permalink
Add relevant commit helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bnchrch committed Dec 16, 2023
1 parent b6de513 commit 1ba7845
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/actions/run-dagger-pipeline/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ runs:
exit 78
fi
- name: Get the relevant commit SHA
id: get-relevant-commit-sha
shell: bash
run: |
echo "Relevant commit SHA: $RELEVANT_SHA"
echo "RELEVANT_SHA=$RELEVANT_SHA" >> $GITHUB_ENV
env:
RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Docker login
uses: docker/login-action@v1
with:
Expand Down Expand Up @@ -119,7 +128,7 @@ runs:
shell: bash
run: |
if [ "${{ github.ref }}" != "master" ] && [ "${{ steps.changes.outputs.pipelines_any_changed }}" == "true" ]; then
echo "AIRBYTE_CI_DOWNLOAD_URL=https://storage.googleapis.com/dev-airbyte-cloud-connector-metadata-service/airbyte-ci/releases/ubuntu/${{ github.sha }}/airbyte-ci" >> $GITHUB_ENV
echo "AIRBYTE_CI_DOWNLOAD_URL=https://storage.googleapis.com/dev-airbyte-cloud-connector-metadata-service/airbyte-ci/releases/ubuntu/${{ env.RELEVANT_SHA }}/airbyte-ci" >> $GITHUB_ENV
else
echo "AIRBYTE_CI_DOWNLOAD_URL=https://connectors.airbyte.com/airbyte-ci/releases/ubuntu/latest/airbyte-ci" >> $GITHUB_ENV
fi
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/airbyte-ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ jobs:
with:
ref: ${{ github.sha }} # This is required to make sure that the same commit is checked out on all runners

- name: Get the relevant commit SHA
id: get-relevant-commit-sha
shell: bash
run: |
echo "Relevant commit SHA: $RELEVANT_SHA"
echo "RELEVANT_SHA=$RELEVANT_SHA" >> $GITHUB_ENV
env:
RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Install Python
id: install_python
uses: actions/setup-python@v4
Expand All @@ -61,7 +70,7 @@ jobs:

- uses: actions/upload-artifact@v2
with:
name: airbyte-ci-${{ matrix.os }}-${{ github.sha }}
name: airbyte-ci-${{ matrix.os }}-${{ env.RELEVANT_SHA }}
path: airbyte-ci/connectors/pipelines/dist/${{ env.BINARY_FILE_NAME }}

- name: Authenticate to Google Cloud Dev
Expand All @@ -76,14 +85,14 @@ jobs:
uses: google-github-actions/upload-cloud-storage@v1
with:
path: airbyte-ci/connectors/pipelines/dist/${{ env.BINARY_FILE_NAME }}
destination: ${{ env.DEV_GCS_BUCKET_NAME }}/airbyte-ci/releases/${{ matrix.os }}/${{ github.sha }}
destination: ${{ env.DEV_GCS_BUCKET_NAME }}/airbyte-ci/releases/${{ matrix.os }}/${{ env.RELEVANT_SHA }}
headers: |-
cache-control:public, max-age=10
- name: Print pre-release public url
id: print_pre_release_public_url
run: |
echo "https://storage.googleapis.com/${{ env.DEV_GCS_BUCKET_NAME }}/airbyte-ci/releases/${{ matrix.os }}/${{ github.sha }}/${{ env.BINARY_FILE_NAME }}"
echo "https://storage.googleapis.com/${{ env.DEV_GCS_BUCKET_NAME }}/airbyte-ci/releases/${{ matrix.os }}/${{ env.RELEVANT_SHA }}/${{ env.BINARY_FILE_NAME }}"
# if master, upload per version and latest to prod bucket

Expand Down

0 comments on commit 1ba7845

Please sign in to comment.