-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (84 loc) · 2.46 KB
/
create-release.yml
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
name: Create Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: 'Version of the release to cut (e.g. 1.2.3)'
required: false
concurrency: release
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Checkout
uses: actions/checkout@v3
- name: Run Unit Tests
run: ./scripts/unit.sh
release:
name: Release
runs-on: ubuntu-latest
needs: unit
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Checkout
uses: actions/checkout@v3
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
- name: Reset Draft Release
id: reset
uses: paketo-buildpacks/github-config/actions/release/reset-draft@main
with:
repo: ${{ github.repository }}
token: ${{ github.token }}
- name: Increment Tag
id: increment
uses: paketo-buildpacks/github-config/actions/tag/increment-tag@main
with:
current_version: ${{ steps.reset.outputs.current_version }}
- name: Set Release Tag
id: tag
run: |
tag="${{ github.event.inputs.version }}"
if [ -z "${tag}" ]; then
tag="${{ steps.increment.outputs.tag }}"
fi
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Package Bootstrapper
run : ./scripts/package.sh --version ${{ steps.tag.outputs.tag }}
- name: Create Draft Release
uses: paketo-buildpacks/github-config/actions/release/create@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
tag_name: v${{ steps.tag.outputs.tag }}
target_commitish: ${{ github.sha }}
name: v${{ steps.tag.outputs.tag }}
draft: true
assets: |
[
{
"path": "build/bootstrapper-darwin",
"name": "bootstrapper-darwin",
"content_type": "application/octet-stream"
},
{
"path": "build/bootstrapper-linux",
"name": "bootstrapper-linux",
"content_type": "application/octet-stream"
},
{
"path": "build/bootstrapper-windows.exe",
"name": "bootstrapper-windows.exe",
"content_type": "application/octet-stream"
}
]