-
Notifications
You must be signed in to change notification settings - Fork 30
96 lines (85 loc) · 2.74 KB
/
release.yaml
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
name: "🚀🟢 Release"
on:
workflow_dispatch:
inputs:
version:
type: string
description: "Version to release, in format 'vX.Y.Z'"
make_latest:
type: boolean
description: "Make latest"
default: true
draft:
type: boolean
description: "Is draft"
default: false
jobs:
push_images:
name: "Pull candidate images and push to release"
runs-on: ubuntu-latest
permissions:
packages: write
outputs:
image-version: ${{ steps.push_image.outputs.image-version }}
strategy:
matrix:
image_name:
- "datalens-control-api"
- "datalens-data-api"
env:
cr_url: "ghcr.io/${{ github.repository_owner }}"
steps:
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.cr_url }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push release tag
id: push_image
run: |
version="${{ github.event.inputs.version }}"
image_version="${version#"v"}"
image_url_rc="${{ env.cr_url }}/${{ matrix.image_name }}:${image_version}-rc.1"
echo "Pulling release candidate image: ${image_url_rc}"
docker pull ${image_url_rc}
image_url_release="${{ env.cr_url }}/${{ matrix.image_name }}:${image_version}"
echo "Pushing release image: ${image_url_release}"
docker tag "${image_url_rc}" "${image_url_release}"
docker push "${image_url_release}"
echo "image-version=${image_version}" >> $GITHUB_OUTPUT
run_e2e_tests:
name: "Run E2E tests"
needs: [ push_images ]
uses: datalens-tech/datalens-backend/.github/workflows/run_e2e.yml@main
with:
image_version: ${{ needs.push_images.outputs.image-version }}
secrets: inherit
release:
name: "Create release"
needs: [ push_images, run_e2e_tests ]
runs-on: ubuntu-latest
permissions:
contents: write
env:
branch: "release/${{ github.event.inputs.version }}"
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v2
with:
ref: "${{ env.branch }}"
fetch-depth: 0
- name: Create release
id: create_release
working-directory: .github/.scripts
run: |
gh release create \
--repo ${{ github.repository_owner }}/${{ github.event.repository.name }} \
${{ github.event.inputs.version }} \
--target ${{ env.branch }} \
${{ github.event.inputs.make_latest == 'true' && '--latest' || '' }} \
${{ github.event.inputs.draft == 'true' && '--draft' || '' }} \
--generate-notes
env:
GH_TOKEN: ${{ github.token }}