-
Notifications
You must be signed in to change notification settings - Fork 21
124 lines (111 loc) · 4.23 KB
/
tag-and-release.yml
File metadata and controls
124 lines (111 loc) · 4.23 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# This creates release on pushing with tag
name: tag-and-release
on:
push:
tags:
- 'v*'
defaults:
run:
working-directory: cli
jobs:
createrelease:
name: createrelease
runs-on: [ubuntu-latest]
outputs:
release_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.get_version.outputs.VERSION }}
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
prerelease: false
draft: true
build:
needs: [createrelease]
name: build
strategy:
matrix:
os: [ubuntu-latest, windows-2019, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install graalvm
uses: DeLaGuardo/setup-graalvm@master
with:
graalvm: 21.3.0
java: java11
# Install Native Image,Set Version and Build from Linux and MACOS
- if: matrix.os != 'windows-2019'
name: Install native-image
run: gu install native-image
- if: matrix.os != 'windows-2019'
name: Set version
run: ./mvnw versions:set -DnewVersion="${{needs.createrelease.outputs.version}}"
- if: matrix.os != 'windows-2019'
name: Build native executable
run: ./mvnw package -Dnative
# Install Native Image,Set Version and Build from Windows
- if: matrix.os == 'windows-2019'
name: Install native-image
run: |
%JAVA_HOME%/bin/gu.cmd install native-image
shell: cmd
- if: matrix.os == 'windows-2019'
name: Configure Pagefile
# Increased the page-file size due to memory-consumption of native-image command
# For details see https://github.com/actions/virtual-environments/issues/785
uses: al-cheb/configure-pagefile-action@v1.2
- if: matrix.os == 'windows-2019'
name: Set version
run: mvnw versions:set -DnewVersion="${{ needs.createrelease.outputs.version }}"
shell: cmd
- if: matrix.os == 'windows-2019'
name: Build native executable
# Invoke the native-image build with the necessary Visual Studio tooling/environment intialized
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
mvnw package -Dnative"
shell: cmd
- if: matrix.os == 'ubuntu-latest'
name: Upload native executable Linux
id: upload-native-executable-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.createrelease.outputs.release_url }}
asset_path: ./cli/target/starfix-${{needs.createrelease.outputs.version}}.zip
asset_name: starfix-${{needs.createrelease.outputs.version}}-linux.zip
asset_content_type: application/octet-stream
- if: matrix.os == 'windows-2019'
name: Upload native executable Windows
id: upload-native-executable-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.createrelease.outputs.release_url }}
asset_path: ./cli/target/starfix-${{needs.createrelease.outputs.version}}.zip
asset_name: starfix-${{needs.createrelease.outputs.version}}-win64.zip
asset_content_type: application/octet-stream
- if: matrix.os == 'macos-latest'
name: Upload native executable macos
id: upload-native-executable-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.createrelease.outputs.release_url}}
asset_path: ./cli/target/starfix-${{needs.createrelease.outputs.version}}.zip
asset_name: starfix-${{needs.createrelease.outputs.version}}-macos.zip
asset_content_type: application/octet-stream