generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 13
executable file
·87 lines (70 loc) · 2.22 KB
/
create-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
name: "Create release"
on:
workflow_dispatch:
inputs:
name:
description: 'Release name'
default: ""
required: true
jobs:
verify-head-status:
name: Verify head
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check tag
run: ./scripts/check_release_tag.sh ${{ github.event.inputs.name }}
- name: Check image
run: ./scripts/check_image.sh ${{ github.ref_name }}
- name: Verify
run: ./scripts/verify-status.sh ${{ github.ref_name }}
# run-unit-tests:
# name: Unit tests
# needs: verify-head-status
# uses: "./.github/workflows/run-unit-tests.yaml"
create-draft:
name: Create draft release
needs: verify-head-status
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/create_changelog.sh ${{ github.event.inputs.name }}
- name: Create draft release
id: create-draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_ID=$(./scripts/create_draft_release.sh ${{ github.event.inputs.name }})
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Create lightweight tag
run: |
git tag ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}
outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}
# devOps-Insights:
# name: DevOps Insights
# needs: [verify-head-status, create-draft, run-unit-tests]
# uses: "./.github/workflows/metrics.yaml"
publish-release:
name: Publish release
needs: [verify-head-status, create-draft]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Publish release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }}