forked from dbt-labs/dbt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer core team membership in changie (dbt-labs#6420)
* part 1 of env var for core team * add logic to use env vars to generate changelog * modify version bump to add members via env var * pull in main and tweak * add token * changes for testing * split step * remove leading slash * add version check * more debugging * try curl * try more things * try more things * chnage auth * put back token * update permissions * add back fishtown pat * use new pat * fix typo * swap token * comment out list teams * change url * debug path * add continue * change core case * more tweaks * send output to file * add file view * make array * tweak * remove [] * add quotes * add tojson * add quotes to set * tweak * fix id * tweaks * more * more * remove new lines * more tweaks * update to generate changelog * remove debugging bits * use central version-bump * use correct author list * testing with changelog team automation * add new token to input * move secret * remove testing aspects from workflow * clean up team logic * explicitly send secret * move bumpversion comment * move comments * point workflow back tp main * point to branch for testing * point back to main * inherit secrets
- Loading branch information
Showing
4 changed files
with
17 additions
and
114 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
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 |
---|---|---|
|
@@ -20,106 +20,9 @@ on: | |
description: 'The version number to bump to (ex. 1.2.0, 1.3.0b1)' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
bump: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "[DEBUG] Print Variables" | ||
run: | | ||
echo "all variables defined as inputs" | ||
echo The version_number: ${{ github.event.inputs.version_number }} | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python3 -m venv env | ||
source env/bin/activate | ||
pip install --upgrade pip | ||
- name: Add Homebrew to PATH | ||
run: | | ||
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | ||
- name: Install Homebrew packages | ||
run: | | ||
brew install pre-commit | ||
brew tap miniscruff/changie https://github.com/miniscruff/changie | ||
brew install changie | ||
- name: Audit Version and Parse Into Parts | ||
id: semver | ||
uses: dbt-labs/actions/parse-semver@v1 | ||
with: | ||
version: ${{ github.event.inputs.version_number }} | ||
|
||
- name: Set branch value | ||
id: variables | ||
run: | | ||
echo "BRANCH_NAME=prep-release/${{ github.event.inputs.version_number }}_$GITHUB_RUN_ID" >> $GITHUB_OUTPUT | ||
- name: Create PR branch | ||
run: | | ||
git checkout -b ${{ steps.variables.outputs.BRANCH_NAME }} | ||
git push origin ${{ steps.variables.outputs.BRANCH_NAME }} | ||
git branch --set-upstream-to=origin/${{ steps.variables.outputs.BRANCH_NAME }} ${{ steps.variables.outputs.BRANCH_NAME }} | ||
- name: Bump version | ||
run: | | ||
source env/bin/activate | ||
pip install -r dev-requirements.txt | ||
env/bin/bumpversion --allow-dirty --new-version ${{ github.event.inputs.version_number }} major | ||
git status | ||
- name: Run changie | ||
run: | | ||
if [[ ${{ steps.semver.outputs.is-pre-release }} -eq 1 ]] | ||
then | ||
changie batch ${{ steps.semver.outputs.base-version }} --move-dir '${{ steps.semver.outputs.base-version }}' --prerelease '${{ steps.semver.outputs.pre-release }}' | ||
else | ||
changie batch ${{ steps.semver.outputs.base-version }} --include '${{ steps.semver.outputs.base-version }}' --remove-prereleases | ||
fi | ||
changie merge | ||
git status | ||
# this step will fail on whitespace errors but also correct them | ||
- name: Remove trailing whitespace | ||
continue-on-error: true | ||
run: | | ||
pre-commit run trailing-whitespace --files .bumpversion.cfg CHANGELOG.md .changes/* | ||
git status | ||
# this step will fail on newline errors but also correct them | ||
- name: Removing extra newlines | ||
continue-on-error: true | ||
run: | | ||
pre-commit run end-of-file-fixer --files .bumpversion.cfg CHANGELOG.md .changes/* | ||
git status | ||
- name: Commit version bump to branch | ||
uses: EndBug/add-and-commit@v7 | ||
with: | ||
author_name: 'Github Build Bot' | ||
author_email: '[email protected]' | ||
message: 'Bumping version to ${{ github.event.inputs.version_number }} and generate CHANGELOG' | ||
branch: '${{ steps.variables.outputs.BRANCH_NAME }}' | ||
push: 'origin origin/${{ steps.variables.outputs.BRANCH_NAME }}' | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
author: 'Github Build Bot <[email protected]>' | ||
base: ${{github.ref}} | ||
title: 'Bumping version to ${{ github.event.inputs.version_number }} and generate changelog' | ||
branch: '${{ steps.variables.outputs.BRANCH_NAME }}' | ||
labels: | | ||
Skip Changelog | ||
version_bump_and_changie: | ||
uses: dbt-labs/actions/.github/workflows/version-bump.yml@main | ||
with: | ||
version_number: ${{ inputs.version_number }} | ||
secrets: inherit # ok since what we are calling is internally maintained |