-
Notifications
You must be signed in to change notification settings - Fork 65
78 lines (71 loc) · 2.56 KB
/
release_production_workflow.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
name: plugin release to Production workflow
on:
pull_request:
types:
- closed
branches:
- 'master'
paths-ignore:
- '**.md'
- 'docs/**.md'
- '**.sh'
jobs:
Prepare-Release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.tag-step.outputs.PLUGIN_VERSION}}
output2: ${{ steps.tag-step.outputs.RELEASE_BRANCH_NAME}}
steps:
- uses: actions/checkout@v3
- name: Login to GitHub
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME}}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL}}
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- uses: mdecoleman/[email protected]
id: vars
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Determine release tag and release branch
id: tag-step
run: |
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_OUTPUT
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_OUTPUT
Check-Packages:
needs: [Prepare-Release]
uses: ./.github/workflows/check_packages.yml
with:
plugin_version: ${{ needs.Prepare-Release.outputs.output1 }}
secrets: inherit
Update-Links:
needs: [Prepare-Release, Check-Packages]
uses: ./.github/workflows/update_links.yml
secrets: inherit
Generate-Tag:
needs: [Prepare-Release, Check-Packages, Update-Links]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create a version tag and push it
run: |
echo "Pushing release tag: ${{ needs.Prepare-Release.outputs.output1 }}!"
git checkout master
echo "Checked out to master"
git pull origin master
git tag ${{ needs.Prepare-Release.outputs.output1 }}
echo "Created release tag"
git push origin ${{needs.Prepare-Release.outputs.output1}}
echo "Pushed release tag ${{ needs.Prepare-Release.outputs.output1 }}"
Release-To-Production:
needs: [Prepare-Release, Check-Packages, Update-Links, Generate-Tag]
uses: ./.github/workflows/release_to_production.yml
with:
plugin_version: ${{ needs.Prepare-Release.outputs.output1 }}
branch_name: ${{ needs.Prepare-Release.outputs.output2 }}
secrets: inherit