-
Notifications
You must be signed in to change notification settings - Fork 47
49 lines (49 loc) · 1.94 KB
/
publish-release.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
name: Publish release on CCB approval
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
jobs:
publish-release:
runs-on: ubuntu-22.04
name: Publish release on CCB approval
permissions:
contents: write
steps:
- name: Get reviewed release
run: |
ISSUES=$(curl --request GET \
--url "$JIRA_BASE_URL/rest/api/3/search?jql=project%20%3D%20CLI%20AND%20issuetype%20%3D%20Release%20AND%20status%20%3D%20Reviewed" \
--user "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \
--header 'Accept: application/json')
echo "FIX_VERSION=$(printf '%s' $ISSUES | jq -r '.issues[0].fields.fixVersions[0].name' | sed 's/AcquiaCLI//')" >> $GITHUB_ENV
echo "ISSUE_KEY=$(printf '%s' $ISSUES | jq -r '.issues[0].key')" >> $GITHUB_ENV
env:
JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
- name: Login to Jira
if: env.FIX_VERSION != 'null' && env.ISSUE_KEY != 'null'
uses: acquia/gajira-login@master
env:
JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
- name: Start release
if: env.FIX_VERSION != 'null' && env.ISSUE_KEY != 'null'
uses: acquia/gajira-transition@master
with:
issue: ${{ env.ISSUE_KEY }}
transition: Start Release
- name: Publish release
if: env.FIX_VERSION != 'null' && env.ISSUE_KEY != 'null'
run: |
gh release edit $FIX_VERSION --prerelease=false --latest --repo acquia/cli
env:
GH_TOKEN: ${{ github.token }}
- name: Close release
if: env.FIX_VERSION != 'null' && env.ISSUE_KEY != 'null'
uses: acquia/gajira-transition@master
with:
issue: ${{ env.ISSUE_KEY }}
transition: Released