Publishing the draft bundle for 1.1.1 #6
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
# **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@v4 | |
# 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@v4 | |
- name: "Audit Version And Parse Into Parts" | |
id: semver | |
uses: dbt-labs/actions/parse-semver@v1.1.0 | |
with: | |
version: ${{ inputs.tag }} | |
- name: "Set Python Versions" | |
id: build-list | |
run: ./.github/scripts/supported_python_versions.sh \ | |
${{ steps.semver.outputs.major}} \ | |
${{ steps.semver.outputs.minor }} | |
- name: Print Supported Python Versions | |
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-12", "ubuntu-latest"] | |
name: ${{ matrix.os }} - ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: "Checkout Repo" | |
uses: actions/checkout@v4 | |
- name: "Set Linux OS" | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsasl2-dev libxml2-dev libxslt-dev git gcc g++ unixodbc-dev | |
echo "os_platform=linux" >> $GITHUB_ENV | |
- name: "Set Mac OS" | |
if: matrix.os == 'macos-12' | |
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" |