-
Notifications
You must be signed in to change notification settings - Fork 34
76 lines (59 loc) · 2.22 KB
/
build.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
name: "Build xPilot (Release)"
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
windows:
uses: ./.github/workflows/windows.yml
secrets: inherit
macos:
uses: ./.github/workflows/macos.yml
secrets: inherit
linux:
uses: ./.github/workflows/linux.yml
secrets: inherit
########################## Create Release ##########################
release:
runs-on: ubuntu-latest
needs: [linux, windows, macos]
if: github.ref_type == 'tag' && contains(github.ref_name, 'v')
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Reorganize
run: mv xPilot*/* . && rmdir xPilot*/
- name: Merge artifacts
run: |
mkdir -p artifacts/Linux && mv Linux.zip/* artifacts/Linux
mkdir -p artifacts/Windows && mv Windows.zip/* artifacts/Windows
mkdir -p artifacts/macOS && mv macOS.zip/* artifacts/macOS
cd artifacts && zip -r ../Artifacts-${{ steps.get_version.outputs.version-without-v }}.zip .
- name: Create release notes
run: |
cat > CHANGELOG.txt << EOF
## Download
- [Windows](https://github.com/xpilot-project/xpilot/releases/download/${{ steps.get_version.outputs.version }}/xPilot-${{ steps.get_version.outputs.version-without-v }}-Windows.exe)
- [macOS](https://github.com/xpilot-project/xpilot/releases/download/${{ steps.get_version.outputs.version }}/xPilot-${{ steps.get_version.outputs.version-without-v }}-MacOS.dmg)
- [Linux](https://github.com/xpilot-project/xpilot/releases/download/${{ steps.get_version.outputs.version }}/xPilot-${{ steps.get_version.outputs.version-without-v }}-Linux.run)
---
### Added
### Changed
### Fixed
EOF
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
name: xPilot ${{ steps.get_version.outputs.version }}
prerelease: true
draft: true
body_path: CHANGELOG.txt
files: |
xPilot*
Artifacts*.zip