-
Notifications
You must be signed in to change notification settings - Fork 85
91 lines (81 loc) · 2.29 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
---
name: release
run-name: Release ${{ inputs.tag }}
on:
workflow_dispatch:
inputs:
tag:
description: Tag
required: true
artifacts-name:
description: Artifacts name to promote
required: true
jobs:
verify-release:
name: Verify if tag is valid
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Fetch tags
run: git fetch --tags
- name: Check if tag matches the branch name
shell: bash
run: |
[[ "refs/heads/development/${{ github.event.inputs.tag }}" == "${{ github.ref }}."* ]]
- name: Check if tag matches VERSION file
shell: bash
run: |
source VERSION
[[ "${{ github.event.inputs.tag }}" == "$VERSION_FULL" ]]
- name: Check if tag has not already been created
shell: bash
run: |
! git show-ref --tags ${{ github.event.inputs.tag }} --quiet
release:
name: Release
runs-on: ubuntu-20.04
needs:
- verify-release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if version is a pre-release
shell: bash
run: |
source VERSION
echo "VERSION_SUFFIX=${VERSION_SUFFIX}" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
generate_release_notes: true
target_commitish: ${{ github.sha }}
prerelease: ${{ env.VERSION_SUFFIX != '' }}
promote:
runs-on: ubuntu-20.04
needs:
- verify-release
- release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Promote artifacts
uses: scality/action-artifacts@v4
with:
method: promote
name: ${{ github.event.inputs.artifacts-name }}
tag: ${{ github.event.inputs.tag }}
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}