generated from geekcell/terraform-aws-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (87 loc) · 2.45 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
---
#####################
## Create releases ##
#####################
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#
name: Release
on:
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
pull_request:
types: [ labeled ]
#################
# Start the job #
#################
jobs:
###############
# Steps below #
###############
create-release:
name: Create Release
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
############################
# Checkout the source code #
############################
- name: Checkout Code
uses: actions/[email protected]
###################################
# Bump version depending on label #
###################################
- name: Bump version
if: "!startsWith(github.ref, 'refs/tags/')"
id: bumpr
uses: haya14busa/action-bumpr@v1
###################
# Update the tags #
###################
- name: Update tag
if: "!steps.bumpr.outputs.skip"
uses: haya14busa/action-update-semver@v1
with:
tag: ${{ steps.bumpr.outputs.next_version }}
################
# Get tag name #
################
- name: Get tag name
id: tag
uses: haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}
##################
# Create release #
##################
- name: Create release
uses: softprops/action-gh-release@v1
if: "steps.tag.outputs.value != ''"
with:
name: Release ${{ steps.tag.outputs.value }}
body: ${{ steps.bumpr.outputs.message }}
tag_name: ${{ steps.tag.outputs.value }}
draft: false
prerelease: false
###########################
# Release preview comment #
###########################
release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
############################
# Checkout the source code #
############################
- name: Checkout Code
uses: actions/[email protected]
#######################
# Post status comment #
#######################
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1