-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename workflows, fix checkout bug, fix job name issue
- Loading branch information
Showing
3 changed files
with
162 additions
and
159 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,125 @@ | ||
# **what?** | ||
# Moves a bundle from draft to published. Then tests all installtion methods. | ||
|
||
# **why?** | ||
# This allows testing a bundle before officially releasing it. | ||
|
||
# **when?** | ||
# This is currently triggered manually. | ||
|
||
# **how** | ||
# Call workflow dispatch. For input-version please use the semantic version | ||
# representing the release of the dependency you want to incorporate into a new | ||
# bundle. | ||
|
||
name: Publish a Draft Bundle | ||
run-name: Publishing the draft bundle for ${{ inputs.tag }} | ||
permissions: | ||
packages: read | ||
contents: write | ||
pull-requests: read | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: The draft release tag (i.e. 1.5.17). | ||
type: string | ||
required: true | ||
|
||
workflow_call: | ||
inputs: | ||
tag: | ||
description: The draft release tag (i.e. 1.5.17). | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
publish-bundle: | ||
name: "Publish the bundle" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout Repo" | ||
uses: actions/checkout@v3 | ||
|
||
# non-zero exit code when the release does not exist and is not currently in draft status | ||
- name: "Check bundle exists in draft state" | ||
shell: bash | ||
run: | | ||
bash ./.github/scripts/audit_draft_bundle.sh "${{ inputs.tag }}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: "Publish draft bundle" | ||
id: publish-draft | ||
run: | | ||
echo ${{ inputs.tag }} | ||
gh release edit ${{ inputs.tag }} --draft=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-python-matrix: | ||
name: "Audit Version and Build Python Release Matrix" | ||
runs-on: ubuntu-latest | ||
needs: ["publish-bundle"] | ||
outputs: | ||
python_versions: ${{ steps.build-list.outputs.versions }} | ||
|
||
steps: | ||
- name: "Checkout Repo" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Audit Version And Parse Into Parts" | ||
id: semver | ||
uses: dbt-labs/actions/[email protected] | ||
with: | ||
version: ${{ inputs.tag }} | ||
|
||
- name: "Set Python Versions" | ||
id: build-list | ||
run: ./.github/scripts/supported_python_versions.sh ${{ steps.semver.outputs.minor }} | ||
|
||
- name: Print Support of Python Versions Other Than 3.8 | ||
run: | | ||
echo "${{ steps.build-list.outputs.versions }}" | ||
test-bundle: | ||
needs: [build-python-matrix] | ||
strategy: | ||
# run even if some fail so we get a full picture. At this point linux/3.8 is already released anyways so there's no reason to stop | ||
fail-fast: false | ||
matrix: | ||
python-version: ${{ fromJSON(needs.build-python-matrix.outputs.python_versions) }} | ||
os: ["macos-latest", "ubuntu-latest"] | ||
|
||
name: ${{ matrix.os }} - ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: "Checkout Repo" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Set Linux OS" | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
echo "os_platform=linux" >> $GITHUB_ENV | ||
- name: "Set Mac OS" | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
echo "os_platform=mac" >> $GITHUB_ENV | ||
- name: "Test install from Github Release" | ||
uses: ./.github/actions/test_install | ||
with: | ||
tag: "${{ inputs.tag }}" | ||
python_version: "${{ matrix.python-version }}" | ||
os_platform: "${{ env.os_platform }}" | ||
draft: false | ||
|
||
- name: "Post Notification" | ||
run: | | ||
title="Test Install Successful" | ||
message="Installation and version command run successful for os_platform=${{ matrix.os }}, Python=${{ matrix.python-version }}, version=${{ inputs.tag }}" | ||
echo "::notice $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 |
---|---|---|
@@ -1,122 +1,50 @@ | ||
# **what?** | ||
# Moves a bundle from draft to published. Then tests all installtion methods. | ||
# This workflow creates a draft bundle for a single dbt version then publishes the draft | ||
# This maps a semver string like "1.0.1" to a requirements file like | ||
# "v1.1.latest.requirements.txt". | ||
|
||
# **why?** | ||
# This allows testing a bundle before officially releasing it. | ||
# To centralize the full release bundle process | ||
|
||
# **when?** | ||
# This is currently triggered manually. | ||
# Manuall triggered | ||
|
||
# **how** | ||
# Call workflow dispatch. For input-version please use the semantic version | ||
# representing the release of the dependency you want to incorporate into a new | ||
# bundle. | ||
# Publish the draft release, test it and if everything is successful, publish the draft as a final release | ||
|
||
name: Publish a Draft Bundle | ||
run-name: Publishing the draft bundle for ${{ inputs.tag }} | ||
permissions: | ||
packages: read | ||
contents: write | ||
pull-requests: read | ||
name: Release a Bundle | ||
run-name: Releasing bundle for ${{ inputs.version_number }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: The release tag (i.e. 1.5.17). | ||
type: string | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
version_number: | ||
description: The release version number (i.e. 1.0.0b1). | ||
type: string | ||
required: true | ||
|
||
workflow_call: | ||
inputs: | ||
version_number: | ||
description: The release version number (i.e. 1.0.0b1). | ||
type: string | ||
required: true | ||
|
||
workflow_call: | ||
inputs: | ||
tag: | ||
description: The release tag (i.e. 1.5.17). | ||
type: string | ||
required: true | ||
permissions: | ||
packages: read | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
publish-bundle: | ||
name: "Publish the bundle" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout Repo" | ||
uses: actions/checkout@v3 | ||
|
||
# non-zero exit code when the release does not exist and is not currently in draft status | ||
- name: "Check bundle exists in draft state" | ||
shell: bash | ||
run: | | ||
bash ./.github/scripts/audit_draft_bundle.sh "${{ inputs.tag }}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: "Publish draft bundle" | ||
id: publish-draft | ||
run: | | ||
echo ${{ inputs.tag }} | ||
gh release edit ${{ inputs.tag }} --draft=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-python-matrix: | ||
name: Audit Version and Build Python Release Matrix | ||
runs-on: ubuntu-latest | ||
needs: ["publish-bundle"] | ||
outputs: | ||
python_versions: ${{ steps.build-list.outputs.versions }} | ||
|
||
steps: | ||
- name: "Checkout Repo" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Audit Version And Parse Into Parts" | ||
id: semver | ||
uses: dbt-labs/actions/[email protected] | ||
with: | ||
version: ${{ inputs.tag }} | ||
|
||
- name: "Set Python Versions" | ||
id: build-list | ||
run: ./.github/scripts/supported_python_versions.sh ${{ steps.semver.outputs.minor }} | ||
|
||
- name: Print Support of Python Versions Other Than 3.8 | ||
run: | | ||
echo "${{ steps.build-list.outputs.versions }}" | ||
test-bundle: | ||
needs: [publish-bundle, build-python-matrix] | ||
strategy: | ||
# run even if some fail so we get a full picture. At this point linux/3.8 is already released anyways so there's no reason to stop | ||
fail-fast: false | ||
matrix: | ||
python-version: ${{ fromJSON(needs.build-python-matrix.outputs.python_versions) }} | ||
os: ["macos-latest", "ubuntu-latest"] | ||
|
||
name: ${{ matrix.os }} - ${{ matrix.python-version }}} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: "Set Linux OS" | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
echo "os_platform=linux" >> $GITHUB_ENV | ||
- name: "Set Mac OS" | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
echo "os_platform=mac" >> $GITHUB_ENV | ||
- name: "Test install from Github Release" | ||
uses: ./.github/actions/test_install | ||
with: | ||
tag: "${{ inputs.tag }}" | ||
python_version: "${{ matrix.python-version }}" | ||
os_platform: "${{ env.os_platform }}" | ||
draft: false | ||
|
||
- name: "Post Notification" | ||
run: | | ||
title="Test Install Successful" | ||
message="Installation and version command run successful for os_platform=${{ matrix.os }}, Python=${{ matrix.python-version }}, version=${{ needs.create-bundle.outputs.created_tag }}" | ||
echo "::notice $title::$message" | ||
release-draft-bundles: | ||
name: Call Release Workflow for ${{ inputs.version_number }} | ||
uses: ./.github/workflows/release_draft_bundle.yml | ||
with: | ||
version_number: ${{ inputs.version_number }} | ||
|
||
publish-bundles: | ||
needs: [release-draft-bundles] | ||
name: Call Release Workflow for ${{ inputs.version_number }} | ||
uses: ./.github/workflows/publish_draft_bundle.yml | ||
with: | ||
tag: ${{ needs.release-draft-bundles.outputs.tag }} |