-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (100 loc) · 2.86 KB
/
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
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
name: release
permissions:
contents: write
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
defaults:
run:
shell: bash
jobs:
all:
name:
All
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- x86_64-apple-darwin
- arm64-apple-darwin
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-musl
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
native: true
- target: x86_64-apple-darwin
os: macos-latest
native: true
- target: arm64-apple-darwin
os: macos-latest
native: true
- target: x86_64-pc-windows-msvc
os: windows-latest
native: true
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
native: true
runs-on: ${{ matrix.os }}
steps:
# An issue with BSD Tar causes sporadic failures on macOS.
# c.f https://github.com/actions/cache/issues/403
- name: Install GNU Tar
if: matrix.os == 'macos-latest'
run: |
brew install gnu-tar
echo /usr/local/opt/gnu-tar/libexec/gnubin > $GITHUB_PATH
- name: Update Ubuntu Packages
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
- name: Download source
uses: actions/checkout@v2
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
- name: Install Just
uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Toolchain Versions Used
run: |
just --version
crystal --version
- name: Build Justprep
run: just static=true crystal/build
- name: Package
id: package
if: startsWith(github.ref, 'refs/tags/')
run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{ matrix.target }}
shell: bash
- name: Publish
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
files: ${{ steps.package.outputs.archive }}
prerelease: ${{ steps.is_prerelease.outputs.value }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: crystal/bin/justprep
# asset_name: ${{ matrix.asset-name }}
# tag: ${{ github.ref }}
# printInputs:
# runs-on: ubuntu-latest
# steps:
# - run: |
# echo "Log level: ${{ github.event.inputs.logLevel }}"
# echo "Tags: ${{ github.event.inputs.tags }}"