-
Notifications
You must be signed in to change notification settings - Fork 255
112 lines (99 loc) · 3.46 KB
/
release.yaml
File metadata and controls
112 lines (99 loc) · 3.46 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
---
name: release
run-name: release ${{ inputs.tag }}
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to be released'
required: true
env:
PROJECT_NAME: ${{ github.event.repository.name }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Install Oras
run: |
curl -L https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz | \
tar -xz -C /usr/local/bin oras
env:
ORAS_VERSION: 1.2.2
- name: Push dashboards into the production namespace
run: |
oras push ghcr.io/${{ github.repository }}/${{ env.PROJECT_NAME }}-dashboards:${{ github.event.inputs.tag }} \
dashboard.json:application/grafana-dashboard+json \
alerts.yaml:application/prometheus-alerts+yaml
working-directory: monitoring
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
target: production
tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push test coverage image
uses: docker/build-push-action@v5
with:
context: .
push: true
target: testcoverage
tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}-testcoverage
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push federation image
uses: docker/build-push-action@v5
with:
push: true
context: images/federation
provenance: false
build-args:
CLOUDSERVER_VERSION=${{ github.event.inputs.tag }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}-federation
labels: |
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
cache-from: type=gha,scope=federation
cache-to: type=gha,mode=max,scope=federation
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
name: Release ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
generate_release_notes: true
target_commitish: ${{ github.sha }}
trigger-kms-release:
runs-on: ubuntu-latest
needs: release
if: github.repository_owner == 'scality'
steps:
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.ACTIONS_APP_ID }}
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Trigger scality-kms release workflow
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh workflow run release.yaml \
--repo scality/scality-kms \
--ref main \
--field cloudserver-version=${{ github.event.inputs.tag }}