diff --git a/.github/workflows/call-skip.yml b/.github/workflows/call-skip.yml deleted file mode 100644 index b02ed964..00000000 --- a/.github/workflows/call-skip.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Check Skipping Steps - -on: - workflow_dispatch: - -defaults: - run: - shell: bash - -permissions: read-all - -jobs: - skip-all-steps: - permissions: read-all - uses: ./.github/workflows/workflow_skips.yml - - echo-line: - name: "Check for changelog entry in cli" - runs-on: ubuntu-latest - needs: skip-all-steps - steps: - - run: echo "running" diff --git a/.github/workflows/changie_bot_testing.yml b/.github/workflows/changie_bot_testing.yml deleted file mode 100644 index 7c3ac553..00000000 --- a/.github/workflows/changie_bot_testing.yml +++ /dev/null @@ -1,68 +0,0 @@ -# **what?** -# When bots create a PR, this action will add a corresponding changie yaml file to that -# PR when a specific label is added. -# -# The file is created off a template: -# -# kind: -# body: -# time: -# custom: -# Author: -# Issue: 4904 -# PR: -# -# **why?** -# Automate changelog generation for more visability with automated bot PRs. -# -# **when?** -# Once a PR is created, label should be added to PR before or after creation. You can also -# manually trigger this by adding the appropriate label at any time. -# -# **how to add another bot?** -# Add the label and changie kind to the include matrix. That's it! -# - -name: Bot Changelog - -on: - pull_request: - # catch when the PR is opened with the label or when the label is added - types: [labeled] - -permissions: - contents: write - pull-requests: read - -jobs: - generate_changelog: - strategy: - matrix: - include: - - label: "dependencies" - changie_kind: "Dependency" - - label: "snyk" - changie_kind: "Security" - runs-on: ubuntu-latest - - steps: - - - name: generate custom fields - id: custom - shell: bash - run: | - CUSTOM_FIELDS='{"Author": "emmyoop", "Issue": "1234"}' - echo "fields=$CUSTOM_FIELDS" >> $GITHUB_OUTPUT - - - name: Create and commit changelog on bot PR - if: ${{ contains(github.event.pull_request.labels.*.name, matrix.label) }} - id: bot_changelog - uses: emmyoop/changie_bot@er/use-changie-cli - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - commit_author_name: "Github Build Bot" - commit_author_email: "" - commit_message: "Add automated changelog yaml from template for bot PR" - changie_kind: ${{ matrix.changie_kind }} - label: ${{ matrix.label }} - custom_changelog_json: ${{ steps.custom.outputs.fields }} diff --git a/.github/workflows/community-label.yml b/.github/workflows/community-label.yml deleted file mode 100644 index bf6be39a..00000000 --- a/.github/workflows/community-label.yml +++ /dev/null @@ -1,38 +0,0 @@ -# **what?** -# Label a PR with a `community` label when a PR is opened by a user outside core/adapters - -# **why?** -# To streamline triage and ensure that community contributions are recognized and prioritized - -# **when?** -# When a PR is opened, not in draft or moved from draft to ready for review - - -name: Label community PRs - -on: - pull_request: - types: [opened, ready_for_review] - -defaults: - run: - shell: bash - -permissions: - # issues: write # labels PRs - pull-requests: write # labels PRs - -jobs: - open_issues: - # If this PR already has the community label, no need to relabel it - # If this PR is opened and not draft, determine if it needs to be labeled - # if the PR is converted out of draft, determine if it needs to be labeled - if: | - (!contains(github.event.pull_request.labels.*.name, 'community') && - (github.event.action == 'opened' && github.event.pull_request.draft == false ) || - github.event.action == 'ready_for_review' ) - uses: dbt-labs/actions/.github/workflows/label-community.yml@er/fix-permissions - with: - github_team: "core" - label: 'community' - secrets: inherit diff --git a/.github/workflows/conditionals.yml b/.github/workflows/conditionals.yml deleted file mode 100644 index 13f73053..00000000 --- a/.github/workflows/conditionals.yml +++ /dev/null @@ -1,125 +0,0 @@ -# Test flow of skipped jobs with dependencies - -name: Test Conditionals - -on: - workflow_dispatch: - - -jobs: - job1: - name: Job 1 - runs-on: ubuntu-latest - steps: - - name: Echo Job 1 - run: | - echo Job 1 - - skipped-job: - # always skip! - if: ${{ github.event_name != 'workflow_dispatch'}} - name: Skipped Job - runs-on: ubuntu-latest - needs: - - job1 - steps: - - name: Echo Job 2 - run: | - echo Job 2 - - job3: - name: Job 3 - runs-on: ubuntu-latest - needs: - - job1 - steps: - - name: Echo Job 3 - run: | - echo Job 3 - - conditional-job: - if: ${{ always() && (needs.skipped-job.result == 'success' || needs.skipped-job.result == 'skipped') && (needs.job3.result == 'success') }} - name: Conditional Job - runs-on: ubuntu-latest - needs: - - skipped-job - - job3 - steps: - - name: Echo Job 5 - run: | - echo Job 5 - - job6: - name: "Job 6 with always()" - if: ${{ always() }} - runs-on: ubuntu-latest - needs: - - conditional-job - steps: - - name: Echo Job 6 - run: | - echo Job 6 - - job7: - name: "Job 7 with always()" - if: ${{ always() }} - runs-on: ubuntu-latest - needs: - - job6 - - conditional-job - steps: - - name: Echo Job 7 - run: | - echo Job 7 - - job8: - name: "Job 8 no always()" - runs-on: ubuntu-latest - needs: - - job6 - - conditional-job - steps: - - name: Echo Job 8 - run: | - echo Job 8 - - job9: - name: "Job 9 always() only job6" - if: ${{ always() }} - runs-on: ubuntu-latest - needs: - - job6 - steps: - - name: Echo Job 9 - run: | - echo Job 9 - - job10: - name: "Job 10 no always() only job6" - runs-on: ubuntu-latest - needs: - - job6 - steps: - - name: Echo Job 10 - run: | - echo Job 10 - - job11: - name: "Job 11 no always() only job9" - runs-on: ubuntu-latest - needs: - - job9 - steps: - - name: Echo Job 11 - run: | - echo Job 11 - - job12: - name: "Job 12 no always() only job11" - runs-on: ubuntu-latest - needs: - - job11 - steps: - - name: Echo Job 11 - run: | - echo Job 11 diff --git a/.github/workflows/fork_tests.yml b/.github/workflows/fork_tests.yml deleted file mode 100644 index acd374fb..00000000 --- a/.github/workflows/fork_tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: "Pull request checks" -run-name: "Pull request checks for public forks" -on: - pull_request_target: - types: [opened, reopened, synchronize, labeled, unlabeled] - -permissions: - contents: read -env: - CI_LABEL: "ci:approve-public-fork-ci" - -jobs: - check-run-approval: - permissions: - pull-requests: write - contents: read - # to prevent CI from running against public forks without us looking at the code, we will check for the presence of the proper label - runs-on: ubuntu-latest - steps: - - name: "If the event is to synchronize, we should remove the label from the PR" - if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'synchronize' }} && github.event.pull_request.head.repo.full_name != github.repository }} && contains(github.event.pull_request.labels.*.name, env.CI_LABEL) }} - run: | - echo "Synchronizing PR, removing '${{ env.CI_LABEL }}' label" - gh pr edit ${{ github.event.pull_request.number }} --remove-label ${{ env.CI_LABEL }} --repo ${{ github.repository }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: "Check that forks have the '${{ env.CI_LABEL }}' label" - if: ${{ github.event.pull_request.head.repo.full_name != github.repository && !contains(github.event.pull_request.labels.*.name, env.CI_LABEL) }} - run: | - echo "${{ github.event.pull_request.head.repo.full_name != github.repository }}" - echo "${{ github.event.pull_request.head.repo.full_name }}" - echo "${{ github.repository }}" - echo "${{ !contains(github.event.pull_request.labels.*.name, env.CI_LABEL) }}" - echo ${{ github.event.pull_request.labels }} - msg="Pull request is from a public fork but does not have the '${{ env.CI_LABEL }}' label. No CI will be run." - echo "::error::$msg" - exit 1 - - main-job: - needs: check-run-approval - runs-on: ubuntu-latest - steps: - - run: | - echo "Hello, world!" diff --git a/.github/workflows/github_output_testing.yml b/.github/workflows/github_output_testing.yml deleted file mode 100644 index bac57471..00000000 --- a/.github/workflows/github_output_testing.yml +++ /dev/null @@ -1,82 +0,0 @@ -# **what?** -# Testing formatting with $GITHUB_OUTPUT - -name: Test GITHUB_OUTPUT - -on: - workflow_dispatch: - -permissions: read-all - -jobs: - set-vars: - runs-on: ubuntu-latest - outputs: - package_name: ${{ steps.variables.outputs.package_name }} - steps: - - name: Set output value - id: variables - run: | - echo "package_name=dashes-are-cool" >> $GITHUB_OUTPUT - - transform-vars-1: - runs-on: ubuntu-latest - needs: [set-vars] - outputs: - build_arg_name1: ${{ steps.variables.outputs.build_arg_name1 }} - steps: - - name: Print Var - run: | - echo "transform-vars-1" - echo "${{ needs.set-vars.outputs.package_name }}" - - - name: Set output value - id: variables - run: | - echo "build_arg_name1="$(echo ${{ needs.set-vars.outputs.package_name }} | sed 's/\-/_/g') >> $GITHUB_OUTPUT - - transform-vars-2: - runs-on: ubuntu-latest - needs: [set-vars] - outputs: - build_arg_name2: ${{ steps.variables.outputs.build_arg_name2 }} - steps: - - name: Print Var - run: | - echo "transform-vars-2" - echo "${{ needs.set-vars.outputs.package_name }}" - - - name: Set output value - id: variables - run: | - echo "build_arg_name2=$(echo ${{ needs.set-vars.outputs.package_name }} | sed 's/\-/_/g')" >> $GITHUB_OUTPUT - - - transform-vars-3: - runs-on: ubuntu-latest - needs: [set-vars] - outputs: - build_arg_name3: ${{ steps.variables.outputs.build_arg_name3 }} - steps: - - name: Print Var - run: | - echo "transform-vars-3" - echo "${{ needs.set-vars.outputs.package_name }}" - - - name: Set output value - id: variables - run: | - PACKAGE_NAME=$(echo ${{ needs.set-vars.outputs.package_name }} | sed 's/\-/_/g') - echo "build_arg_name3=$PACKAGE_NAME" >> $GITHUB_OUTPUT - - - print-vars: - runs-on: ubuntu-latest - needs: [transform-vars-1, transform-vars-2, transform-vars-3] - steps: - - name: Print Vars - id: print - run: | - echo "${{ needs.transform-vars-1.outputs.build_arg_name1 }}" - echo "${{ needs.transform-vars-2.outputs.build_arg_name2 }}" - echo "${{ needs.transform-vars-3.outputs.build_arg_name3 }}" diff --git a/.github/workflows/github_release_test.yml b/.github/workflows/github_release_test.yml deleted file mode 100644 index d7ccb760..00000000 --- a/.github/workflows/github_release_test.yml +++ /dev/null @@ -1,116 +0,0 @@ -# **what?** -# Release workflow provides the following steps: -# - checkout the given commit; -# - validate version in sources and changelog file for given version; -# - bump the version and generate a changelog if needed; -# - merge all changes to the target branch if needed; -# - run unit and integration tests against given commit; -# - build and package that SHA; -# - release it to GitHub and PyPI with that specific build; -# -# **why?** -# Ensure an automated and tested release process -# -# **when?** -# This workflow can be run manually on demand or can be called by other workflows - -name: Release to GitHub and PyPI - -on: - workflow_dispatch: - inputs: - sha: - description: "The commit sha for the release" - type: string - required: true - version_number: - description: "The release version number (i.e. 1.0.0b1)" - type: string - required: true - changelog_path: - description: "Path to changelog file" - type: string - default: ".changes/1.6.0.md" - required: true - test_run: - description: "Test run (Publish release as draft)" - type: boolean - default: false - required: false - workflow_call: - inputs: - sha: - description: "The commit sha for the release" - type: string - required: true - version_number: - description: "The release version number (i.e. 1.0.0b1)" - type: string - required: true - changelog_path: - description: "Path to changelog file" - type: string - default: ".changes/1.6.0.md" - required: true - test_run: - description: "Test run (Publish release as draft)" - type: boolean - default: false - required: false - - -permissions: - contents: write # this is the permission that allows creating a new release - -defaults: - run: - shell: bash - -jobs: - log-inputs: - name: Log Inputs - runs-on: ubuntu-latest - steps: - - name: "[DEBUG] Print Variables" - run: | - echo The last commit sha in the release: ${{ inputs.sha }} - echo The release version number: ${{ inputs.version_number }} - echo Changelog path: ${{ inputs.changelog_path }} - echo Test Run: ${{ inputs.test_run }} - - generate-fake-artifact: - name: Generate fake artifact to release - runs-on: ubuntu-latest - - steps: - - name: "Create dummy changelog" - run: | - echo "This is the fancy changelog!" > "${{ inputs.changelog_path}}" - - - name: "Create dummy artifact" - run: | - echo "This is the atrifact!" > "dist/my_artifact.txt" - - - name: "Upload Build Artifact - ${{ inputs.version_number }}" - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.version_number }} - path: | - ${{ inputs.changelog_path }} - ./dist/ - !dist/dbt-${{ inputs.version_number }}.tar.gz - retention-days: 5 - - github-release: - name: GitHub Release - needs: [generate-fake-artifact] - - uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@er/track-latest - - with: - sha: ${{ inputs.sha }} - version_number: ${{ inputs.version_number }} - changelog_path: ${{ inputs.changelog_path }} - test_run: ${{ inputs.test_run }} - - diff --git a/.github/workflows/issues_tests.yml b/.github/workflows/issues_tests.yml deleted file mode 100644 index a134e3f2..00000000 --- a/.github/workflows/issues_tests.yml +++ /dev/null @@ -1,36 +0,0 @@ - - -name: Output Issue Metadata - -on: - issues: - types: [labeled, closed] - pull_request_target: - types: [labeled, closed] - -defaults: - run: - shell: bash - -permissions: - issues: read # opens new issues - - -jobs: - open_issues: - runs-on: ubuntu-latest - steps: - - name: "Is the issue open?" - id: is_open - run: | - echo ${{ github.event.issue.state }} - echo ${{ github.event.issue.number }} - echo ${{ github.event.issue.state_reason }} - echo ${{ github.event.issue.comments }} - - name: "Is the issue open?" - run: | - echo ${{ github.event.issue.pr.number }} - echo ${{ github.event.pull_request.number }} - - name: "Pick one" - run: | - echo ${{ github.event.pull_request.number || github.event.issue.number }} diff --git a/.github/workflows/label-printing.yml b/.github/workflows/label-printing.yml deleted file mode 100644 index 970c6a63..00000000 --- a/.github/workflows/label-printing.yml +++ /dev/null @@ -1,56 +0,0 @@ -# **what?** -# grab multiple labels off an issue and run as a matrix - -name: Label Play - -on: - issues: - types: [opened, labeled] - -permissions: - issues: read - -jobs: - - find-labels: - runs-on: ubuntu-latest - outputs: - labels: ${{ steps.generate-labels.outputs.labels }} - steps: - - name: Generate Labels - id: generate-labels - run: | - LABELS='${{ toJSON(github.event.issue.labels.*.name) }}' - echo "labels<> $GITHUB_OUTPUT - echo "${LABELS}" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - print-labels-json-matrix: - runs-on: ubuntu-latest - needs: - - find-labels - strategy: - matrix: - label: ${{ fromJSON(needs.find-labels.outputs.labels) }} - steps: - - name: "[DEBUG] - Print Job Inputs" - shell: bash - id: echo_inputs - run: | - echo "all variables defined as ouputs in previous jobs" - echo "Running for label: ${{ matrix.label }}" - - print-labels-list: - runs-on: ubuntu-latest - needs: - - find-labels - steps: - - name: "[DEBUG] - Print Job Inputs" - shell: bash - id: echo_inputs - run: | - echo "all variables defined as ouputs in previous jobs" - echo "fromJSON label: ${{ fromJSON(needs.find-labels.outputs.labels) }}" - echo "Plain text label: ${{ needs.find-labels.outputs.labels }}" - - diff --git a/.github/workflows/label_trigger.yml b/.github/workflows/label_trigger.yml deleted file mode 100644 index fa905dbb..00000000 --- a/.github/workflows/label_trigger.yml +++ /dev/null @@ -1,58 +0,0 @@ - -name: Test Triggering a Workflow With labels -run-name: "Testing for PR #${{ github.event.pull_request.number }}" - -on: - pull_request_target: - types: [labeled, closed] - -defaults: - run: - shell: bash - -permissions: read-all - - -jobs: - - debug: - runs-on: ubuntu-latest - steps: - - name: Echo the labels - run: | - echo "All the labels are: ${{ github.event.pull_request.labels}}" - echo "The event label is: ${{ github.event.label.name }}" - - name: A different way to print labels - if: github.event.label.name == 'user docs' - run: | - echo "the label was added" - echo "event name is:" ${{ github.event_name }} - echo "event type is:" ${{ github.event.action }} - - conditional_labels: - if: | - (github.event.pull_request.merged == true) && - ((github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'user docs')) || - (github.event.action == 'labeled' && github.event.label.name == 'user docs')) - runs-on: ubuntu-latest - steps: - - name: Echo the labels - run: | - echo "The PR is merged: ${{ github.event.pull_request.merged }}" - echo "The event label is: ${{ github.event.label.name }}" - - minor_conditional_labels: - if: ${{ contains(github.event.pull_request.label.name, 'special label') }} - runs-on: ubuntu-latest - steps: - - name: Echo the labels - run: | - echo "Triggered by the special label" - - minor_conditional_labels_retrigger: - if: ${{ contains(github.event.pull_request.labels.*.name, 'special label') }} - runs-on: ubuntu-latest - steps: - - name: Echo the labels - run: | - echo "Triggered by any label" diff --git a/.github/workflows/open_issues.yml b/.github/workflows/open_issues.yml deleted file mode 100644 index 7d04048b..00000000 --- a/.github/workflows/open_issues.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Open issues in another repo when a PR is labeled -run-name: "Open an issue in action_testing when a merged PR is labeled user doc" - -on: - pull_request: - types: [closed, labeled] - -defaults: - run: - shell: bash - -permissions: - issues: write # opens new issues - pull-requests: write # comments on PRs - - -jobs: - generate_body: - if: contains( github.event.pull_request.labels.*.name, 'needs-docs') && github.event.pull_request.merged == true - runs-on: ubuntu-latest - outputs: - issue_body: ${{ steps.set_body.outputs.issue_body }} - steps: - - name: Get issue title - id: set_lines - run: | - echo "first_line=### Link to the page on docs.getdbt.com requiring updates" >> $GITHUB_OUTPUT - echo "second_line=### What part(s) of the page would you like to see updated?" >> $GITHUB_OUTPUT - echo "third_line=### Additional information" >> $GITHUB_OUTPUT - - - name: Set issue body - id: set_body - run: | - issue_body="${{steps.set_lines.outputs.first_line }}\n\n${{steps.set_lines.outputs.second_line }}\n\n${{steps.set_lines.outputs.third_line }}" - echo $issue_body - echo "issue_body='$issue_body'" >> $GITHUB_OUTPUT - - open_issues: - needs: [generate_body] - uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@er/docs-issue - with: - issue_repository: "emmyoop/action_testing" - issue_title: "This is my title" - issue_body: "${{ needs.generate_body.outputs.issue_body }}" - issue_labels: "needs-docs,bug" - secrets: - FISHTOWN_BOT_PAT: ${{ secrets.FISHTOWN_BOT_PAT }} \ No newline at end of file diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml deleted file mode 100644 index 3e6acbd3..00000000 --- a/.github/workflows/playground.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Playground for Workflow Testing - -on: - workflow_dispatch: - inputs: - sha: - description: 'The last commit sha in the release' - required: true - version_number: - description: 'The release version number (i.e. 1.0.0b1)' - required: true - default: 2.2.2 - -defaults: - run: - shell: bash - -jobs: - - get_release_by_tag: - name: Test GH CLI find release by tag - runs-on: ubuntu-latest - - steps: - - name: Find Release by tag - id: cli_tag - run: | - release_commit=`gh release view v${{ inputs.version_number }} --json targetCommitish` - echo "::set-output name=releaseJson::$release_commit" - - get_release_by_commit: - name: Test GH CLI find by commit - runs-on: ubuntu-latest - - steps: - - name: Find Release by tag - id: cli_tag - run: | - release_commit=`gh release view v${{ inputs.version_number }} --json targetCommitish` - echo "::set-output name=releaseJson::$release_commit" - - create_release: - name: Test GH CLI Release Creation - runs-on: ubuntu-latest - - steps: - - name: Find Release by tag - id: cli_tag - run: | - VERSION=v${{ version_number }} - CHANGELOG_FILE=CHANGELOG.md - TITLE="my_repo v1.2.3" - PRERELEASE='' - gh release create $VERSION -t $TITLE -F $CHANGELOG_FILE --target ${{ input.sha }} $PRERELEASE - gh release create v1.2.3 -t "my_repo v1.2.3" -F CHANGELOG.md --target ${{ input.sha }} '' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 7c833417..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: "Build and Release via Action" - -on: - workflow_dispatch: - inputs: - sha: - description: 'The last commit sha in the release' - required: true - type: string - version_number: - description: 'The release version number (ie. 1.0.0b1)' - default: '2.2.2' # TODO: remove when done testing! - required: true - type: string - build_script_path: - description: 'The path to the build script(default: ./scripts/build-dist.sh))' - default: 'scripts/build-dist.sh' - required: true - type: string - target_branch: - description: 'Target branch to release from' - required: true - type: string - is_prod: - # TODO: need an action to clean up test builds for testing purposes - description: 'Is this a production build/release' - default: false - required: true - type: boolean - # outputs: - # name: - # description: "Package name" - -# TODO: validate -permissions: - contents: write - -jobs: - release_prep: - uses: dbt-labs/actions/.github/workflows/_release-prep.yml@er/release - with: - sha: ${{ github.event.inputs.sha }} - version_number: ${{ github.event.inputs.version_number }} - target_branch: ${{ github.event.inputs.target_branch }} - - - build: - needs: [release_prep] - uses: dbt-labs/actions/.github/workflows/_build.yml@er/release - with: - sha: ${{ needs.release_prep.outputs.final_sha }} - version_number: ${{ github.event.inputs.version_number }} - build_script_path: ${{ github.event.inputs.build_script_path }} - s3_bucket_name: whatevs - package_test_command: pip freeze # this should not be input at this level, defaults to `dbt --version`` - secrets: - AWS_ACCESS_KEY_ID: abc - AWS_SECRET_ACCESS_KEY: 123 - - github_release: - needs: [build] - uses: dbt-labs/actions/.github/workflows/_github-release.yml@er/release - with: - sha: ${{ github.event.inputs.sha }} - version_number: ${{ github.event.inputs.version_number }} - file_uploads: | - action_testing-${{github.event.inputs.version_number}}-py3-none-any.whl - action_testing-${{github.event.inputs.version_number}}.tar.gz - - # pypi_release: - # needs: [github_release] - # uses: dbt-labs/actions/.github/workflows/_pypi-release.yml@er/release - # with: - # is_prod: ${{ github.event.inputs.is_prod }} \ No newline at end of file diff --git a/.github/workflows/release_original.yml b/.github/workflows/release_original.yml deleted file mode 100644 index d6dcd4f6..00000000 --- a/.github/workflows/release_original.yml +++ /dev/null @@ -1,181 +0,0 @@ -# **what?** -# Take the given commit, run unit tests specifically on that sha, build and -# package it, and then release to GitHub and PyPi with that specific build - -# **why?** -# Ensure an automated and tested release process - -# **when?** -# This will only run manually with a given sha and version - -name: Release to GitHub and PyPi - -on: - workflow_dispatch: - inputs: - sha: - description: 'The last commit sha in the release' - required: true - version_number: - description: 'The release version number (i.e. 1.0.0b1)' - required: true - -defaults: - run: - shell: bash - -jobs: - # unit: - # name: Unit test - - # runs-on: ubuntu-latest - - # env: - # TOXENV: "unit" - - # steps: - # - name: Check out the repository - # uses: actions/checkout@v2 - # with: - # persist-credentials: false - # ref: ${{ github.event.inputs.sha }} - - # - name: Set up Python - # uses: actions/setup-python@v2 - # with: - # python-version: 3.8 - - # - name: Install python dependencies - # run: | - # pip install --user --upgrade pip - # pip install tox - # pip --version - # tox --version - - # - name: Run tox - # run: tox - - build: - name: build packages - - runs-on: ubuntu-latest - - steps: - - name: Check out the repository - uses: actions/checkout@v2 - with: - persist-credentials: false - ref: ${{ github.event.inputs.sha }} - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install python dependencies - run: | - pip install --user --upgrade pip - pip install --upgrade setuptools wheel twine check-wheel-contents - pip --version - - - name: Build distributions - run: ./scripts/build-dist.sh - - - name: Show distributions - run: ls -lh dist/ - - - name: Check distribution descriptions - run: | - twine check dist/* - - - name: Check wheel contents - run: | - check-wheel-contents dist/*.whl --ignore W007,W008 - - - uses: actions/upload-artifact@v2 - with: - name: dist - path: | - dist/ - !dist/dbt-${{github.event.inputs.version_number}}.tar.gz - - test-build: - name: verify packages - - needs: [build] - - runs-on: ubuntu-latest - - steps: - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install python dependencies - run: | - pip install --user --upgrade pip - pip install --upgrade wheel - pip --version - - - uses: actions/download-artifact@v2 - with: - name: dist - path: dist/ - - - name: Show distributions - run: ls -lh dist/ - - - name: Install wheel distributions - run: | - find ./dist/*.whl -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/ - - - name: Check wheel distributions - run: | - dbt --version - - - name: Install source distributions - run: | - find ./dist/*.gz -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/ - - - name: Check source distributions - run: | - dbt --version - - github-release: - name: GitHub Release - - needs: test-build - - runs-on: ubuntu-latest - - steps: - - uses: actions/download-artifact@v2 - with: - name: dist - path: '.' - - # Need to set an output variable because env variables can't be taken as input - # This is needed for the next step with releasing to GitHub - - name: Find release type - id: release_type - env: - IS_PRERELEASE: ${{ contains(github.event.inputs.version_number, 'rc') || contains(github.event.inputs.version_number, 'b') }} - run: | - echo ::set-output name=isPrerelease::$IS_PRERELEASE - - - name: Creating GitHub Release - uses: softprops/action-gh-release@v1 - with: - name: dbt-core v${{github.event.inputs.version_number}} - tag_name: v${{github.event.inputs.version_number}} - prerelease: ${{ steps.release_type.outputs.isPrerelease }} - target_commitish: ${{github.event.inputs.sha}} - body: | - [Release notes](https://github.com/dbt-labs/dbt-core/blob/main/CHANGELOG.md) - files: | - dbt_postgres-${{github.event.inputs.version_number}}-py3-none-any.whl - dbt_core-${{github.event.inputs.version_number}}-py3-none-any.whl - dbt-postgres-${{github.event.inputs.version_number}}.tar.gz - dbt-core-${{github.event.inputs.version_number}}.tar.gz - diff --git a/.github/workflows/team_membership.yml b/.github/workflows/team_membership.yml deleted file mode 100644 index 9b43c907..00000000 --- a/.github/workflows/team_membership.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Return Team Membership" - -on: - workflow_dispatch: - -permissions: read-all - -env: - ORG: rockmans - TEAM: core - - -jobs: - job_1: - runs-on: ubuntu-latest - - steps: - - name: Set Core Team Membership for Changie Contributors exclusion - run: | - response=$(gh api -H "Accept: application/vnd.github+json" /orgs/{{env.ORG}}/teams/{{env.TEAM}}/members) - echo $response - echo 'CHANGIE_CORE_TEAM=?' >> $GITHUB_ENV diff --git a/.github/workflows/test_team_membership.yml b/.github/workflows/test_team_membership.yml deleted file mode 100644 index 184df834..00000000 --- a/.github/workflows/test_team_membership.yml +++ /dev/null @@ -1,69 +0,0 @@ -# **what?** -# Given a GitHub team handle, output the list of github handles on that team -# -# **why?** -# This is useful for general processing. Currently it is used for Changelog -# contributions and community PR labels. - -# **when?** -# This will run when called by another workflow - -## Important: Your repository will need to be added to the included repositories for IT_TEAM_MEMBERSHIP - - -on: - workflow_call: - inputs: - github_team: - description: "The team to get membership for" - type: string - required: true - default: 'core-group' - outputs: - membership_list: - description: "Space delimited list of GitHub handles" - value: ${{ jobs.team-membership.outputs.team_membership }} - - workflow_dispatch: - inputs: - github_team: - description: "The team to get membership for" - type: string - required: true - default: 'core-group' - -defaults: - run: - shell: bash - -permissions: read-all - -jobs: - team-membership: - runs-on: ubuntu-latest - outputs: - team_membership: ${{ steps.set_team_membership.outputs.team_membership }} - steps: - - name: "Set json File Name" - id: json_file - run: | - echo "name=output_$GITHUB_RUN_ID.json" >> $GITHUB_OUTPUT - - - name: "Get Team Membership" - run: | - gh api -H "Accept: application/vnd.github+json" orgs/rockmans/teams/${{ inputs.github-team }}/members > ${{ steps.json_file.outputs.name }} - env: - GH_TOKEN: ${{ secrets.IT_TEAM_MEMBERSHIP }} - - - name: "Convert file to space delimited list" - id: set_team_membership - run: | - team_list=$(jq -r '.[].login' ${{ steps.json_file.outputs.name }}) - echo $team_list - team_list_single=$(echo $team_list | tr '\n' ' ') - echo $team_list_single - echo "team_membership=$team_list_single" >> $GITHUB_OUTPUT - - - name: "Delete the json File" - run: | - rm ${{ steps.json_file.outputs.name }} diff --git a/.github/workflows/testing-path-changes.yml b/.github/workflows/testing-path-changes.yml index 4df5d361..8f5d3f3d 100644 --- a/.github/workflows/testing-path-changes.yml +++ b/.github/workflows/testing-path-changes.yml @@ -25,23 +25,30 @@ jobs: id: changes # we only have files to check on pull_request triggers with: - # filter exclusions below only take effect when predicate_quantifier is 'every' - predicate-quantifier: 'some' filters: | core_changed: - - 'package/**' - - '!package/**/tests/**' - - '!package/**/*.md' - - '!package/.changes/**' - - '!package/.changie.yaml' + - 'core/package/**' + core_changed_changelog: + - 'core/package/**' + - '!core/package/**/tests/**' + - '!core/package/**/*.md' + - '!core/package/.changes/**' + - '!core/package/.changie.yaml' scripts_changed: - 'scripts/**' - - '!scripts/**/*.md'' + scripts_changed_changelog: + - 'scripts/**' + - '!scripts/**/*.md' + - '!scripts/.changes/**' + - '!scripts/.changie.yaml' - name: Debug Outputs run: | echo "core_changed: ${{ steps.changes.outputs.core_changed }}" + echo "core_changed_changelog: ${{ steps.changes.outputs.core_changed_changelog }}" echo "scripts_changed: ${{ steps.changes.outputs.scripts_changed }}" + echo "scripts_changed_changelog: ${{ steps.changes.outputs.scripts_changed_changelog }}" + predicate-quantifier-every: name: "Check for changes in every path" @@ -52,20 +59,27 @@ jobs: id: changes # we only have files to check on pull_request triggers with: - # filter exclusions below only take effect when predicate_quantifier is 'every' predicate-quantifier: 'every' filters: | core_changed: - - 'package/**' - - '!package/**/tests/**' - - '!package/**/*.md' - - '!package/.changes/**' - - '!package/.changie.yaml' + - 'core/package/**' + core_changed_changelog: + - 'core/package/**' + - '!core/package/**/tests/**' + - '!core/package/**/*.md' + - '!core/package/.changes/**' + - '!core/package/.changie.yaml' scripts_changed: - 'scripts/**' - - '!scripts/**/*.md'' + scripts_changed_changelog: + - 'scripts/**' + - '!scripts/**/*.md' + - '!scripts/.changes/**' + - '!scripts/.changie.yaml' - name: Debug Outputs run: | echo "core_changed: ${{ steps.changes.outputs.core_changed }}" + echo "core_changed_changelog: ${{ steps.changes.outputs.core_changed_changelog }}" echo "scripts_changed: ${{ steps.changes.outputs.scripts_changed }}" + echo "scripts_changed_changelog: ${{ steps.changes.outputs.scripts_changed_changelog }}" \ No newline at end of file diff --git a/.github/workflows/testing-triggers.yml b/.github/workflows/testing-triggers.yml deleted file mode 100644 index 49137df6..00000000 --- a/.github/workflows/testing-triggers.yml +++ /dev/null @@ -1,66 +0,0 @@ - - - -name: "Testing Workflow Trigger Conditionals" - -on: - schedule: - - cron: "* * * * *" # run every minute - workflow_dispatch: - workflow_call: - inputs: - test: - type: string - - -permissions: read-all - -jobs: - job_schedule: - runs-on: ubuntu-latest - steps: - - name: Set output - if: ${{ github.event_name == 'schedule' }} - run: | - echo "running with ${{ github.event.inputs.test }}" - echo "Called by workflow: ${{ github.event.workflow_call.workflow }}" - job_not_schedule: - runs-on: ubuntu-latest - steps: - - name: Set output - if: ${{ github.event_name != 'schedule' }} - run: | - echo "running with ${{ github.event.inputs.test }}" - echo "Called by workflow: ${{ github.event.workflow_call.workflow }}" - job_workflow_dispatch: - runs-on: ubuntu-latest - steps: - - name: Set output - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - echo "running with ${{ github.event.inputs.test }}" - echo "Called by workflow: ${{ github.event.workflow_call.workflow }}" - job_not_workflow_dispatch: - runs-on: ubuntu-latest - steps: - - name: Set output - if: ${{ github.event_name != 'workflow_dispatch' }} - run: | - echo "running with ${{ github.event.inputs.test }}" - echo "Called by workflow: ${{ github.event.workflow_call.workflow }}" - job_workflow_call: - runs-on: ubuntu-latest - steps: - - name: Set output - if: ${{ github.event_name == 'workflow_call' }} - run: | - echo "running with ${{ github.event.inputs.test }}" - echo "Called by workflow: ${{ github.event.workflow_call.workflow }}" - job_not_workflow_call: - runs-on: ubuntu-latest - steps: - - name: Set output - if: ${{ github.event_name != 'workflow_call' }} - run: | - echo "running with ${{ github.event.inputs.test }}" - echo "Called by workflow: ${{ github.event.workflow_call.workflow }}" \ No newline at end of file diff --git a/.github/workflows/testing_vars.yml b/.github/workflows/testing_vars.yml deleted file mode 100644 index 5c01f2d9..00000000 --- a/.github/workflows/testing_vars.yml +++ /dev/null @@ -1,47 +0,0 @@ - - - -name: "Testing Passing Around Variables" - -on: - workflow_dispatch: - - -permissions: read-all - -jobs: - job_1: - runs-on: ubuntu-latest - outputs: - issueId: ${{ steps.extract.outputs.issueId }} - SET_TITLE: ${{ steps.extract.outputs.SET_TITLE }} - - steps: - - name: Set output - id: extract - env: - TITLE: "[CT-1428] just testing" - run: | - issueId=$(echo -n "${{env.TITLE}}" | awk '{print $1}' | awk -F'[][]' '{print $2}') - echo "issueId=$issueId" >> $GITHUB_OUTPUT - echo "SET_TITLE="${{env.TITLE}} >> $GITHUB_OUTPUT - echo "Title: ${{env.TITLE}}" - echo "issueId: $issueId" - - name: Print output - id: echo - run: | - echo "Title: ${{env.SET_TITLE}}" - echo "Issue ID: ${{ steps.extract.outputs.issueId }}" - - job_2: - runs-on: ubuntu-latest - needs: job_1 - steps: - - name: "Print Job 1 Outputs" - shell: bash - id: echo_inputs - run: | - echo "all variables defined as ouputs in previous jobs" - echo "Issue ID: ${{ needs.job_1.outputs.issueId }}" - echo "Issue ID: (env) ${{ env.issueId }}" - echo "SET_TITLE: ${{ env.SET_TITLE }}" diff --git a/.github/workflows/triage-labels.yml b/.github/workflows/triage-labels.yml deleted file mode 100644 index 66d626bb..00000000 --- a/.github/workflows/triage-labels.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Update Triage Label Internal - -on: issue_comment - -defaults: - run: - shell: bash - -permissions: - issues: write - -jobs: - triage_label: - uses: dbt-labs/actions/.github/workflows/swap-labels.yml@er/add-labeler - with: - add_label: "triage" - remove_label: "awaiting_response" - secrets: inherit # this is only acceptable because we own the action we're calling \ No newline at end of file diff --git a/.github/workflows/workflow_call.yml b/.github/workflows/workflow_call.yml deleted file mode 100644 index ec59ac37..00000000 --- a/.github/workflows/workflow_call.yml +++ /dev/null @@ -1,18 +0,0 @@ -# used to call other workflows in testing - - -name: "Testing Workflow Call" - -on: - schedule: - - cron: "* * * * *" # run every minute - workflow_dispatch: - - -permissions: read-all - -jobs: - job_schedule: - uses: ./.github/workflows/testing-triggers.yml - with: - test: "a workflow call" \ No newline at end of file diff --git a/.github/workflows/workflow_skips.yml b/.github/workflows/workflow_skips.yml deleted file mode 100644 index a94a3028..00000000 --- a/.github/workflows/workflow_skips.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Skipping - -on: - workflow_call: - -permissions: read-all - -jobs: - skip: - name: "skip everything" - runs-on: [ubuntu-latest] - permissions: read-all - steps: - - id: changes - # we only have files to check on pull_request triggers - if: false - run: echo "didn't skip" - - - name: Debug Outputs - if: false - run: | - echo "another non skip" diff --git a/.github/workflows/working_dir.yml b/.github/workflows/working_dir.yml deleted file mode 100644 index c383db6f..00000000 --- a/.github/workflows/working_dir.yml +++ /dev/null @@ -1,44 +0,0 @@ - - -name: How do working dirs work - -on: - workflow_dispatch: - - -jobs: - update-branches: - runs-on: ubuntu-latest - - steps: - - name: "Checkout repository" - uses: actions/checkout@v4 - - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: "${{ env.PYTHON_VERSION }}" - - - name: "ls" - run: | - ls - - - name: "ls" - run: | - ls - working-directory: scripts - - - name: "ls" - run: | - ls - working-directory: ./scripts - - - name: "Run script" - run: | - ./printing.py - working-directory: ./scripts - - - name: "Run script" - run: | - ./printing.py - working-directory: scripts diff --git a/core/package/README.md b/core/package/README.md new file mode 100644 index 00000000..3958213b --- /dev/null +++ b/core/package/README.md @@ -0,0 +1 @@ +### important stuff \ No newline at end of file diff --git a/core/package/__init__.py b/core/package/__init__.py index e69de29b..989cb465 100644 --- a/core/package/__init__.py +++ b/core/package/__init__.py @@ -0,0 +1 @@ +# real change that counts \ No newline at end of file