-
Notifications
You must be signed in to change notification settings - Fork 59
70 lines (61 loc) · 2.29 KB
/
scheduled-test-releases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# **what?**
# Nightly releases to GitHub and PyPI. This workflow produces the following outcome:
# - generate and validate data for night release (commit SHA, version number, release branch);
# - pass data to release workflow;
# - night release will be pushed to GitHub as a draft release;
# - night build will be pushed to test PyPI;
#
# **why?**
# Ensure an automated and tested release process for nightly builds
#
# **when?**
# - scheduled with the repository variable DBT_SCHEDULED_TEST_RELEASES_SCHEDULE
# - manually
name: "Scheduled test releases"
on:
schedule:
- cron: ${{ vars.DBT_SCHEDULED_TEST_RELEASES_SCHEDULE }}
workflow_dispatch:
permissions:
contents: write # this is the permission that allows creating a new release
defaults:
run:
shell: bash
jobs:
release-inputs:
name: "Get test release inputs"
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.commit.outputs.sha }}
version: ${{ steps.release-version.outputs.version }}
steps:
- name: "Checkout `${{ github.repository }}`"
uses: actions/checkout@v3
- name: "Set: commit"
id: commit
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: "Set: version"
id: current-version
run: echo "version=$(hatch version)" >> $GITHUB_OUTPUT
- name: "Audit Version And Parse Into Parts"
id: semver
uses: dbt-labs/actions/[email protected]
with:
version: ${{ steps.current-version.outputs.version }}
- name: "Set: release version"
id: release-version
run: |
version="${{ steps.semver.outputs.major }}"
version+=".${{ steps.semver.outputs.minor }}"
version+=".$(${{ steps.semver.outputs.patch }}+1)"
version+="dev$(date +'%m%d%Y')"
echo "version=$version" >> $GITHUB_OUTPUT
release:
name: "Release test release"
needs: release-inputs
uses: ./.github/workflows/release.yml
with:
sha: ${{ needs.release-inputs.outputs.sha }}
version: ${{ needs.release-inputs.outputs.version }}
deploy-environment: "test"
publish-slack-override: true