-
Notifications
You must be signed in to change notification settings - Fork 687
92 lines (92 loc) · 3.79 KB
/
promote-ga.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
name: promote-to-ga
"on":
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
promote-to-ga:
runs-on: ubuntu-latest
name: promote-to-ga
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.GH_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.GH_AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
DEV_REGISTRY: ${{ secrets.DEV_REGISTRY }}
RELEASE_REGISTRY: ${{ secrets.RELEASE_REGISTRY }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Docker Login"
uses: docker/login-action@v2
with:
registry: ${{ (!startsWith(secrets.RELEASE_REGISTRY, 'docker.io/')) && secrets.RELEASE_REGISTRY || null }}
username: ${{ secrets.GH_DOCKER_RELEASE_USERNAME }}
password: ${{ secrets.GH_DOCKER_RELEASE_TOKEN }}
- name: "Install Deps"
uses: ./.github/actions/setup-deps
- name: "make release/promote-oss/to-ga"
run: |
make release/promote-oss/to-ga
- uses: ./.github/actions/after-job
if: always()
- id: check-slack-webhook
name: Assign slack webhook variable
run: echo "slack_webhook_url=${{secrets.SLACK_WEBHOOK_URL}}" >> $GITHUB_OUTPUT
- name: Slack notification
if: steps.check-slack-webhook.outputs.slack_webhook_url && always()
uses: edge/simple-slack-notify@master
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
success_text: 'Emissary GA for ${env.GITHUB_REF} successfully built'
failure_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build failed'
cancelled_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build was cancelled'
fields: |
[{ "title": "Repository", "value": "${env.GITHUB_REPOSITORY}", "short": true },
{ "title": "Branch", "value": "${env.GITHUB_REF}", "short": true },
{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}
]
- uses: ./.github/actions/after-job
if: always()
create-gh-release:
runs-on: ubuntu-latest
needs: [promote-to-ga]
name: "Create GitHub release"
env:
AMBASSADOR_RELENG_NO_GUI: "1"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Install Deps"
uses: ./.github/actions/setup-deps
- name: "gh auth login"
run: |
gh auth login --with-token <<<'${{ secrets.GH_GITHUB_API_KEY }}'
- name: Create GitHub release
id: step-create-gh-release
run: |
make release/ga/create-gh-release
- id: check-slack-webhook
name: Assign slack webhook variable
run: echo "slack_webhook_url=${{secrets.SLACK_WEBHOOK_URL}}" >> $GITHUB_OUTPUT
- name: Slack notification
if: steps.check-slack-webhook.outputs.slack_webhook_url && always()
uses: edge/simple-slack-notify@master
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
success_text: 'Emissary GitHub release was created: ${{ steps.step-create-gh-release.outputs.url }}'
failure_text: 'Emissary GitHub release failed'
cancelled_text: 'Emissary GitHub release was was cancelled'
fields: |
[{ "title": "Repository", "value": "${env.GITHUB_REPOSITORY}", "short": true },
{ "title": "Branch", "value": "${env.GITHUB_REF}", "short": true },
{ "title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}
]
- uses: ./.github/actions/after-job
if: always()