-
Notifications
You must be signed in to change notification settings - Fork 111
94 lines (83 loc) · 2.65 KB
/
dev-to-stage.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Dev to stage
on:
# This workflow manipulates the stage and dev branches regardless of the branch this workflow is run from
workflow_dispatch:
jobs:
get-latest-dev-tag:
outputs:
latest-dev-version: ${{ steps.get-dev-version.outputs.latest-dev-version }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
# Get all tags
fetch-depth: 0
ref: ${{ vars.DEV_BRANCH_NAME }}
- name: Get latest dev version
run: echo latest-dev-version=$(git describe --tags --abbrev=0) >> $GITHUB_OUTPUT
id: get-dev-version
- name: Output latest dev version (for debugging)
run: echo ${{ steps.get-dev-version.outputs.latest-dev-version }}
run-stage-tests:
uses: ./.github/workflows/stage-tests.yml
needs: get-latest-dev-tag
with:
ref: ${{ needs.get-latest-dev-tag.outputs.latest-dev-version }}
secrets: inherit
ff-stage-to-dev-tag:
needs: [
run-stage-tests,
get-latest-dev-tag
]
uses: ./.github/workflows/fast-forward-merge.yml
with:
ref_to_merge: ${{ needs.get-latest-dev-tag.outputs.latest-dev-version }}
base_branch: ${{ vars.STAGE_BRANCH_NAME }}
secrets: inherit
promote-dev-build-to-rc:
needs: ff-stage-to-dev-tag
uses: ./.github/workflows/bump-version.yml
with:
change: 'promote-dev-build-to-rc'
ref: ${{ vars.STAGE_BRANCH_NAME }}
secrets: inherit
delete-dev-artifacts:
needs: promote-dev-build-to-rc
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# We can't upload to the same artifact name with upload-artifact@v4
# So we must delete the artifacts produced by stage-tests.yml
# Before rebuilding the artifacts with the new RC version
- name: Remove artifacts with dev version
uses: geekyeggo/delete-artifact@v4
with:
name: '*.build'
rebuild-artifacts-with-rc-version:
needs: [
delete-dev-artifacts,
promote-dev-build-to-rc
]
uses: ./.github/workflows/build-wheels.yml
with:
ref: ${{ needs.promote-dev-build-to-rc.outputs.bump_sha }}
upload-to-jfrog:
needs: [
rebuild-artifacts-with-rc-version,
promote-dev-build-to-rc
]
name: Upload artifacts to JFrog
uses: ./.github/workflows/upload-to-jfrog.yml
with:
version: ${{ needs.promote-dev-build-to-rc.outputs.new_version }}
secrets: inherit
ff-dev-to-stage:
needs: [
get-latest-dev-tag,
upload-to-jfrog
]
uses: ./.github/workflows/fast-forward-merge.yml
with:
ref_to_merge: origin/${{ vars.STAGE_BRANCH_NAME }}
base_branch: ${{ vars.DEV_BRANCH_NAME }}
secrets: inherit