-
Notifications
You must be signed in to change notification settings - Fork 657
152 lines (144 loc) · 6.11 KB
/
publishRelease.yaml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Triggered by Version Bump merged
#disable all tags and enable all brannches and only version file
on:
push:
branches-ignore:
- update-rc-version
- update-version
paths:
- '!**'
- "indy_node/__version__.json"
jobs:
release-infos:
name: release-infos
runs-on: ubuntu-latest
outputs:
isVersionBump: ${{ steps.get-release-info.outputs.isVersionBump }}
isPreRelease: ${{ steps.get-release-info.outputs.isRC }}
versionTag: ${{ steps.get-release-info.outputs.versionTag }}
component: ${{ steps.get-release-info.outputs.component }}
CACHE_KEY_BUILD: ${{ steps.workflow-setup.outputs.CACHE_KEY_BUILD }}
UBUNTU_VERSION: ${{ steps.workflow-setup.outputs.UBUNTU_VERSION }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ steps.workflow-setup.outputs.distribution }}
publish: ${{ steps.workflow-setup.outputs.publish }}
steps:
- name: checkout source code
uses: actions/checkout@v4
- name: get-release-info
id: get-release-info
uses: hyperledger/indy-shared-gha/.github/actions/get-release-info@v1
with:
versionString: "${{ github.event.head_commit.message }}"
- name: workflow-setup
id: workflow-setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@v1
createRelease:
name: Create Release
needs: [release-infos]
if: needs.release-infos.outputs.isVersionBump == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Node deb Artifacts from Github Action Artifacts
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: releasepr.yaml
workflow_conclusion: success
name: indy_node-deb
path: artifacts/indy_node-deb
- name: Download Node python Artifacts from Github Action Artifacts
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: releasepr.yaml
workflow_conclusion: success
name: indy_node-python
path: artifacts/indy_node-python
- name: Download Node third party dependency Artifacts from Github Action Artifacts
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: releasepr.yaml
workflow_conclusion: success
name: third-party-dependencies
path: artifacts/third-party-dependencies
- uses: actions/upload-artifact@v4
with:
name: third-party-dependencies
path: artifacts/third-party-dependencies
retention-days: 5
- uses: actions/upload-artifact@v4
with:
name: indy_node-deb
path: artifacts/indy_node-deb
retention-days: 5
- uses: actions/upload-artifact@v4
with:
name: indy_node-python
path: artifacts/indy_node-python
retention-days: 5
- name: Zip Files for Release
run: |
zip -r artifacts/indy_node-deb.zip artifacts/indy_node-deb
zip -r artifacts/indy_node-python.zip artifacts/indy_node-python
zip -r artifacts/third-party-dependencies.zip artifacts/third-party-dependencies
- name: Generate Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release-infos.outputs.VERSIONTAG }}
files: |
artifacts/**.zip
generate_release_notes: true
body: "[${{ needs.release-infos.outputs.VERSIONTAG }}] "
prerelease: ${{ needs.release-infos.outputs.isPreRelease }}
target_commitish: ${{ github.event.ref }}
name: "${{ needs.release-infos.outputs.VERSIONTAG }}"
token: ${{ secrets.BOT_PR_PAT }}
publish_artifacts:
name: Publish Artifacts
needs: [release-infos, createRelease]
if: needs.release-infos.outputs.isVersionBump == 'true' && needs.release-infos.outputs.publish == 'true'
uses: hyperledger/indy-shared-gha/.github/workflows/publish_artifacts.yaml@v1
with:
COMPONENT: ${{ needs.release-infos.outputs.component }}
UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
distribution: ${{ needs.release-infos.outputs.distribution }}
moduleName: indy_node
secrets:
INDY_ARTIFACTORY_REPO_CONFIG: ${{ secrets.INDY_ARTIFACTORY_REPO_CONFIG }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
convertPyVersion:
name: "Convert to python version flavour"
needs: [release-infos, publish_artifacts]
uses: hyperledger/indy-shared-gha/.github/workflows/pyVersionConversion.yaml@v1
with:
VERSIONTAG: ${{ needs.release-infos.outputs.VERSIONTAG }}
triggerSovrinUpdate:
runs-on: ubuntu-latest
needs: [release-infos, publish_artifacts, convertPyVersion]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BOT_PR_PAT }}
repository: sovrin-foundation/sovrin
event-type: update-sovrin
client-payload: '{"pyVersion": "${{ needs.convertPyVersion.outputs.pyVersion }}", "debVersion": "${{ needs.convertPyVersion.debVersion }}", "email":"${{ github.event.pusher.email }}"}'
triggerTokenUpdate:
runs-on: ubuntu-latest
needs: [release-infos, publish_artifacts, convertPyVersion]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BOT_PR_PAT }}
repository: sovrin-foundation/token-plugin
event-type: update-token-plugin
client-payload: '{"pyVersion": "${{ needs.convertPyVersion.outputs.pyVersion }}", "debVersion": "${{ steps.conversion.outputs.debVersion }}", "email":"${{ github.event.pusher.email }}"}'