159 lines (136 loc) · 3.67 KB
/
ci.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: CI
on:
push:
branches: '*'
tags: v*
pull_request:
branches:
- master
schedule:
- cron: 0 0 * * *
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
defaults:
run:
shell: bash
jobs:
test:
name: Test
runs-on: ${{ matrix.os == 'freebsd' && 'macOS-latest' || matrix.os }}
continue-on-error: ${{ matrix.nightly == 'nightly' }}
env:
DLP_ARCH: ${{ matrix.arch }}
DLP_COMPILER: ${{ matrix.compiler }}
strategy:
matrix:
arch: [x86_64]
os:
- macOS-latest
- ubuntu-latest
- windows-latest
- freebsd
compiler:
- dmd-latest
- ldc-latest
include:
- os: windows-latest
compiler: dmd-latest
arch: x86
- os: windows-latest
compiler: ldc-latest
arch: x86
- os: ubuntu-latest
compiler: dmd-beta
arch: x86_64
- os: ubuntu-latest
compiler: ldc-beta
arch: x86_64
- os: ubuntu-latest
compiler: dmd-master
arch: x86_64
nightly: nightly
- os: ubuntu-latest
compiler: ldc-master
arch: x86_64
nightly: nightly
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Compiler
uses: dlang-community/setup-dlang@v1
if: ${{ matrix.os != 'freebsd' }}
with:
compiler: ${{ matrix.compiler }}
- name: Test
if: ${{ matrix.os != 'freebsd' }}
run: ./.github/workflows/ci.sh
- name: Test FreeBSD
if: ${{ matrix.os == 'freebsd' }}
uses: cross-platform-actions/action@v0.0.1
with:
shell: bash
operating_system: freebsd
version: 12.2
environment_variables: DLP_COMPILER DLP_ARCH
run: |
sudo pkg update
sudo pkg install -y bash curl gnupg git llvm-90
./.github/workflows/ci.sh
create_release:
name: Create Release
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ${{ matrix.os == 'freebsd' && 'macOS-latest' || matrix.os }}
env:
DLP_ARCH: ${{ matrix.arch }}
DLP_COMPILER: ldc-latest
strategy:
matrix:
arch: [x86_64]
os:
- macOS-latest
- ubuntu-latest
- windows-latest
- freebsd
include:
- os: windows-latest
arch: x86
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Compiler
uses: dlang-community/setup-dlang@v1
if: ${{ matrix.os != 'freebsd' }}
with:
compiler: ${{ env.DLP_COMPILER }}
- name: Build
if: ${{ matrix.os != 'freebsd' }}
run: ./tools/build_release.sh
- name: Build FreeBSD
if: ${{ matrix.os == 'freebsd' }}
uses: vmactions/freebsd-vm@v0.1.3
with:
usesh: true
envs: 'DLP_COMPILER DLP_ARCH'
run: |
pkg update
pkg install -y bash curl gnupg git llvm-90
./tools/build_release.sh
- name: Extract Version
id: version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: DLP ${{ steps.version.outputs.VERSION }}
draft: true
files: |
dlp*.tar.xz
dlp*.7z
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}