-
Notifications
You must be signed in to change notification settings - Fork 38
43 lines (36 loc) · 1.15 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
name: Create release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Retrieve tag name
id: tag_name
run: |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.4.0
- name: Create tarballs and zips
if: startsWith(github.ref, 'refs/tags/')
run: ./release.sh $(git describe --tags --abbrev=0)
- name: Generate Changelog
env:
SOURCE_TAG: ${{ steps.tag_name.outputs.SOURCE_TAG }}
run: |
sed -n "/^## \[${SOURCE_TAG}\]/,/^## \[/p" CHANGELOG.md | sed '1d;2d;$d' | sed '$d' | sed 's/###/##/' > ${SOURCE_TAG}-CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
name: Magic Castle ${{ steps.tag_name.outputs.SOURCE_TAG }}
body_path: ${{ steps.tag_name.outputs.SOURCE_TAG }}-CHANGELOG.txt
draft: true
files: |
releases/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}