-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.39 KB
/
release.yml
File metadata and controls
57 lines (48 loc) · 1.39 KB
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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-and-release:
runs-on: macos-latest
env:
PROGRAM: MicFix
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install git-chglog
run: |
brew tap git-chglog/git-chglog
brew install git-chglog
git-chglog --version
- name: Select Xcode 12
uses: devbotsxyz/xcode-select@v1
with:
version: "12"
- name: Build binary
run: swift build -c release
- name: Set version
id: version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Package to zip
id: zip
run: |
dir=${PROGRAM}-Release-${{ steps.version.outputs.tag }}
echo ::set-output name=filename::${dir}
mkdir ${dir}
cp .build/release/${PROGRAM} ${dir}
cp scripts/* ${dir}
zip -r ${dir}.zip ${dir}
- name: Generate changelog
run: git-chglog -o ${{ steps.version.outputs.tag }}.md ${{ steps.version.outputs.tag }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.zip.outputs.filename }}.zip
draft: true
body_path: ${{ steps.version.outputs.tag }}.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}