-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (127 loc) · 4.74 KB
/
Copy pathuipath-ci-e2e.yml
File metadata and controls
140 lines (127 loc) · 4.74 KB
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
# This is a basic workflow to help you get started with Actions
name: UiPath CI
# Controls when the workflow will run
on:
# Triggers the workflow on call from other repository
workflow_call:
inputs:
environment:
required: true
type: string
projectFilePaths:
required: false
type: string
orchestratorUrl:
required: true
type: string
orchestratorFolder:
required: true
type: string
orchestratorTenant:
required: true
type: string
organizationId:
required: true
type: string
orchestratorApplicationScope:
required: true
type: string
secrets:
orchestratorApplicationId:
required: true
orchestratorApplicationSecret:
required: true
jobs:
uipath-tests:
uses: ./.github/workflows/uipath-tests.yml
with:
environment: ${{ inputs.environment }}
projectFilePaths: ${{ inputs.projectFilePaths }}
orchestratorUrl: ${{ inputs.orchestratorUrl }}
orchestratorTenant: ${{ inputs.orchestratorTenant }}
orchestratorFolder: ${{ inputs.orchestratorFolder }}
organizationId: ${{ inputs.organizationId }}
orchestratorApplicationScope: ${{ inputs.orchestratorApplicationScope }}
secrets:
orchestratorApplicationId: ${{ secrets.orchestratorApplicationId }}
orchestratorApplicationSecret: ${{ secrets.orchestratorApplicationSecret }}
tag:
runs-on: ubuntu-latest
needs: [uipath-tests]
outputs:
new_tag: ${{ steps.set_outputs.outputs.new_tag }}
new_version: ${{ steps.set_outputs.outputs.new_version }}
changelog: ${{ steps.bump_tag.outputs.changelog }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: get_commit_sha
run: |
if [ ${{ github.event_name == 'pull_request' }} ]
then
echo "sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
else
echo "sha=$GITHUB_SHA" >> $GITHUB_OUTPUT
fi
# Outputs: tag = Latest created tag, new_tag = tag generated on this run. Should always be the same for our purposes.
# Using tag in order to enable reruns on failed runs.
- name: Github Tag Bump
id: bump_tag
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request'}}
uses: mikael-andersson91/github-tag-action@v0.2.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main,master
append_commit_sha: true
commit_sha: ${{ steps.get_commit_sha.outputs.sha }}
dry_run: ${{ github.event_name == 'pull_request' }}
# If running on workflow dispatch or schedule, get the latest tag
- id: get_latest_tag
name: Get Latest Tag
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions-ecosystem/action-get-latest-tag@v1
with:
semver_only: true
# Set job output depending on which previous job was run
- id: set_outputs
name: Set Version and Tag Outputs
run: |
if ${{ github.event_name == 'workflow_dispatch' }}
then
tag=${{ steps.get_latest_tag.outputs.tag }}
version="${tag//v}"
echo "new_version=${version}" >> "$GITHUB_OUTPUT"
echo "new_tag=${{ steps.get_latest_tag.outputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "new_version=${{ steps.bump_tag.outputs.new_version }}" >> "$GITHUB_OUTPUT"
echo "new_tag=${{ steps.bump_tag.outputs.new_tag }}" >> "$GITHUB_OUTPUT"
fi
deploy:
needs: tag
uses: ./.github/workflows/uipath-deploy.yml
with:
environment: ${{ inputs.environment }}
tag: ${{ needs.tag.outputs.new_version }}
projectFilePaths: ${{ inputs.projectFilePaths }}
orchestratorUrl: ${{ inputs.orchestratorUrl }}
orchestratorTenant: ${{ inputs.orchestratorTenant }}
orchestratorFolder: ${{ inputs.orchestratorFolder }}
organizationId: ${{ inputs.organizationId }}
orchestratorApplicationScope: ${{ inputs.orchestratorApplicationScope }}
secrets:
orchestratorApplicationId: ${{ secrets.orchestratorApplicationId }}
orchestratorApplicationSecret: ${{ secrets.orchestratorApplicationSecret }}
release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [tag, deploy]
steps:
- uses: actions/checkout@v4
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.tag.outputs.new_tag }}
name: Release ${{ needs.tag.outputs.new_tag }}
body: ${{ needs.tag.outputs.changelog }}
generate_release_notes: true