-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da1191c
commit a8f48a2
Showing
31 changed files
with
759 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: "Audit changelog" | ||
description: "Get metadata about a changelog, including the expected file path, and if it exists" | ||
description: "Get metadata about a changelog" | ||
|
||
inputs: | ||
version: | ||
|
@@ -17,6 +17,11 @@ outputs: | |
runs: | ||
using: composite | ||
steps: | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
echo version : ${{ inputs.version }} | ||
- name: "Parse version: `${{ inputs.version }}`" | ||
id: semver | ||
uses: dbt-labs/actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,23 +12,29 @@ inputs: | |
description: "The email for the commit" | ||
default: "[email protected]" | ||
|
||
outputs: | ||
path: | ||
description: "The file path to the change log, relative to the repo root" | ||
value: ${{ steps.path.outputs.path }} | ||
exists: | ||
description: "Does the changelog exist?" | ||
value: ${{ steps.exists.outputs.exists }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
echo message : ${{ inputs.message }} | ||
echo user : ${{ inputs.user }} | ||
echo email : ${{ inputs.email }} | ||
- name: "Commit and push changes" | ||
shell: bash | ||
run: | | ||
git config user.name "${{ inputs.user }}" | ||
git config user.email "${{ inputs.email }}" | ||
git pull | ||
git add . | ||
git commit -m "${{ inputs.message }}" | ||
git commit -m "[automated] ${{ inputs.message }}" | ||
git push | ||
- name: "[INFO] Committed and pushed changes" | ||
shell: bash | ||
run: | | ||
title="Committed and pushed changes" | ||
message="Committed and pushed changes back up to remote" | ||
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "Merge GitHub branch" | ||
description: "Merge one branch into another on GitHub" | ||
|
||
inputs: | ||
source-branch: | ||
description: "The source branch to be merged" | ||
required: true | ||
target-branch: | ||
description: "The target branch to receive the merge" | ||
required: true | ||
message: | ||
description: "Commit message for the merge" | ||
required: true | ||
delete-source-branch: | ||
description: "Will delete the source branch after merging" | ||
default: "true" | ||
|
||
outputs: | ||
sha: | ||
description: "The commit SHA for the merge" | ||
value: ${{ steps.merge-sha.outputs.sha }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# TODO: are we comfortable passing our bot token to this third party action? | ||
- name: "Merge `${{ inputs.source-branch }}` into `${{ inputs.target-branch }}`" | ||
uses: everlytic/[email protected] | ||
with: | ||
source_ref: ${{ inputs.source-branch }} | ||
target_branch: ${{ inputs.target-branch }} | ||
commit_message_template: "[automated] ${{ inputs.message }}" | ||
github_token: ${{ secrets.FISHTOWN_BOT_PAT }} | ||
|
||
- name: "Checkout `${{ inputs.branch }}`" | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.target-branch }} | ||
|
||
# TODO: see if everlytic/branch-merge has outputs that have this information | ||
- name: "Get commit SHA for the merge" | ||
id: merge-sha | ||
shell: bash | ||
run: | | ||
git pull | ||
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
# TODO: see if everlytic/branch-merge has options to do this | ||
- name: "Delete `${{ inputs.source-branch }}`" | ||
if: ${{ fromJSON(inputs.delete-source-branch) }} | ||
shell: bash | ||
run: git push origin -d ${{ inputs.source-branch }} | ||
|
||
- name: "[INFO] Merged changes" | ||
shell: bash | ||
run: | | ||
title="Merged changes" | ||
message="${{ inputs.source-branch }} was merged into ${{ inputs.target-branch }} with sha ${{ steps.merge-sha.outputs.sha }}" | ||
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "Raise a notification" | ||
description: "Raises a notification to the workflow summary in a standardized pattern" | ||
|
||
inputs: | ||
title: | ||
description: "The notification title" | ||
required: true | ||
message: | ||
description: "The detailed message" | ||
required: true | ||
prefix: | ||
description: "The parent process raising the notification" | ||
default: "INFO" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
run: 'echo "::notice title=$TITLE::$MESSAGE"' | ||
env: | ||
TITLE: "[${{ inputs.prefix }}]: ${{ inputs.title }}" | ||
MESSAGE: ${{ inputs.message }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,32 @@ | ||
name: "Publish to GitHub as draft release" | ||
description: "Publish artifacts from an archive to GitHub as a draft release" | ||
name: "Publish GitHub draft release as full release" | ||
description: "Publish an existing draft release as a non-draft release" | ||
|
||
inputs: | ||
archive-name: | ||
description: "Name of the archive containing the artifacts, leave blank if local" | ||
default: "" | ||
tag: | ||
description: "The release tag to publish under" | ||
description: "The tag to publish (i.e. v1.0.0b1)" | ||
required: true | ||
repo-url: | ||
description: "The URL to the repo (https://github.com/dbt-labs/dbt-adapters" | ||
required: true | ||
sha: | ||
description: "Commit SHA being released" | ||
required: true | ||
changelog-path: | ||
description: "Path to the release notes" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Download artifacts from `${{ inputs.archive-name }}`" | ||
if: ${{ !(inputs.archive-name == "" }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.archive-name }} | ||
path: dist/ | ||
|
||
- name: "[INFO] Downloaded artifacts" | ||
if: ${{ !(inputs.archive-name == "" }} | ||
shell: bash | ||
run: | | ||
title="Downloaded artifacts" | ||
message="Downloaded artifacts from ${{ inputs.archive-name }}" | ||
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" | ||
- name: "[DEBUG] Found artifacts" | ||
shell: bash | ||
working-directory: ${{ inputs.working-dir }} | ||
run: echo $(ls ./dist) | ||
|
||
- name: "Set: pre-release" | ||
id: pre-release | ||
- name: "[DEBUG] Inputs" | ||
shell: bash | ||
run: | | ||
if ${{ contains(inputs.tag, 'rc') || contains(inputs.tag, 'b') || contains(inputs.tag, 'a') }} | ||
then | ||
echo "pre-release=--prerelease" >> $GITHUB_OUTPUT | ||
fi | ||
echo tag : ${{ inputs.tag }} | ||
echo repo-url : ${{ inputs.repo-url }} | ||
- name: "Publish artifacts to GitHub as draft release" | ||
- name: "Publish `${{ inputs.tag }}` as full release" | ||
shell: bash | ||
run: | | ||
gh release create $TAG ./dist/* --title "$TITLE" --notes-file $RELEASE_NOTES --target $COMMIT $PRERELEASE --draft --repo ${{ inputs.repo-url }} | ||
run: gh release edit ${{ inputs.tag }} --repo ${{ inputs.repo-url }} --draft=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: ${{ inputs.tag }} | ||
TITLE: ${{ github.event.repository.name }} ${{ inputs.tag }} | ||
RELEASE_NOTES: ${{ inputs.changelog-path }} | ||
COMMIT: ${{ inputs.sha }} | ||
PRERELEASE: ${{ steps.pre-release.outputs.pre-release }} | ||
DRAFT: ${{ inputs.draft-flag }} | ||
|
||
- name: "[INFO] Published artifacts to GitHub as draft release" | ||
- name: "[INFO] Published draft as full release" | ||
shell: bash | ||
run: | | ||
title="Published artifacts to GitHub as draft release" | ||
message="artifacts: $(ls ./dist) tag: ${{ inputs.tag }} pre-release: ${{ steps.prerelease.outputs.prerelease }}" | ||
title="Released draft as non-draft release on GitHub" | ||
message="tag: ${{ inputs.tag }} repo: ${{ inputs.repo-url }}" | ||
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.