Skip to content

Commit

Permalink
Merge pull request #2 from dbt-labs/addGHA
Browse files Browse the repository at this point in the history
Add Github Release Workflow
  • Loading branch information
colin-rogers-dbt authored Dec 16, 2022
2 parents 242c361 + be1c25a commit 51c77fe
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 1 deletion.
92 changes: 92 additions & 0 deletions .github/workflows/release_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# **what?**
# This workflow generates a zip archive with all the python dependencies
# needed to run core + all adapters for linux, mac OS platforms (future ToDo: add Windows)

# **why?**
# Installing from pip can result in unpredictable installs/runtime environments.
# Each zip serves as a snapshot of dependencies known to work. If any subsequent
# snapshot breaks then a user can simply roll back to a prior release.

# **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
# snapshot. So if there has just been a release of dbt-core of 1.3.3 then pass that
# as the input version (without a `v` prefix).

name: Release a Snapshot
permissions:
packages: read
contents: write
pull-requests: read
on:
workflow_dispatch:
inputs:
version_number:
description: The release version number (i.e. 1.0.0b1).
required: true

jobs:
linux-create:
runs-on: ubuntu-latest
env:
GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: "3.7"
- run: |
sudo apt-get install libsasl2-dev
python -m pip install --user --upgrade pip
pip install -r requirements.txt
- run: |
python release_creation/main.py \
--input-version=${{ inputs.version_number }} \
--operation=create
linux:
needs: linux-create
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
env:
GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: |
sudo apt-get install libsasl2-dev
python -m pip install --user --upgrade pip
pip install -r requirements.txt
- run: |
python release_creation/main.py \
--input-version=${{ inputs.version_number }} \
--operation=update
macos:
needs: linux-create
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
env:
GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: |
python -m pip install --user --upgrade pip
pip install -r requirements.txt
- run: |
python release_creation/main.py \
--input-version=${{ inputs.version_number }} \
--operation=update
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ dmypy.json

# Project Specific
tmp/
.target/
dbt-core*.zip
snapshot*.txt
.snapshot-env*
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# dbt-core-snapshots
Generates bundles of verified adapters + core

###Changing the GHA Workflow
You can test updates to the workflow on your feature branch by calling:
`gh workflow run release_snapshot.yml -f version_number=1.3.0 --ref YOUR_BRANCH`
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
StrEnum
requests
semantic-version~=2.10.0
PyGithub~=1.0
PyGithub~=1.0

0 comments on commit 51c77fe

Please sign in to comment.