-
Notifications
You must be signed in to change notification settings - Fork 12
131 lines (122 loc) · 3.46 KB
/
ci.yml
File metadata and controls
131 lines (122 loc) · 3.46 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
125
126
127
128
129
130
131
name: Artifacts
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: arm64
- os: macos-latest
arch: arm64
- os: windows-latest
arch: x86_64
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: dlang-community/setup-dlang@v2
with:
compiler: ldc-latest
- name: Build
run: |
dub build -b release-debug
- name: Rename artifact on Windows
if: runner.os == 'Windows'
run: |
dir
move build/redub.exe redub-${{ matrix.os }}-${{ matrix.arch }}.exe
- name: Upload artifacts on Windows
uses: actions/upload-artifact@v4
if: runner.os == 'Windows'
with:
name: redub-windows-latest-x86_64.exe
path: redub-windows-latest-x86_64.exe
- name: Rename artifact Unix
if: runner.os != 'Windows'
run: |
ls -R
mv build/redub redub-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload artifacts on Unix
uses: actions/upload-artifact@v4
if: runner.os != 'Windows' && github.ref == 'refs/heads/main'
with:
name: redub-${{ matrix.os }}-${{ matrix.arch }}
path: redub-${{ matrix.os }}-${{ matrix.arch }}
# freebsd:
# strategy:
# matrix:
# arch: [x86_64]
# fail-fast: false
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Run FreeBSD VM
# uses: vmactions/freebsd-vm@v1
# with:
# usesh: true
# prepare: |
# pkg install -y dub ldc
# run: |
# dub build -b release
# - uses: actions/upload-artifact@v4
# if: github.ref == 'refs/heads/main'
# with:
# name: redub-freebsd-14.2-x86_64
# path: build
alpine:
strategy:
matrix:
arch: [x86_64]
fail-fast: false
runs-on: ubuntu-latest
container:
image: alpine:latest
defaults:
run:
shell: sh
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
apk update
apk add --no-cache ldc dub clang
- name: Build
run: |
dub build -b release-debug
- run: mv build/redub redub-alpine-x86_64
- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main'
with:
name: redub-alpine-x86_64
path: redub-alpine-x86_64
update-release:
runs-on: ubuntu-latest
needs: [build, alpine]
permissions:
contents: write
steps:
- name: "Download build artifacts"
uses: actions/[email protected]
with:
merge-multiple: true
# - uses: actions/checkout@v4
# - name: Fetch all tags
# run: git fetch --tags
# - name: "Get latest tag"
# run: echo "TAG=$(git describe --tags --abbrev=0) >> $GITHUB_ENV"
- name: Display structure of downloaded files
run: ls -R
- name: "Update Prebuilt Binaries"
uses: ncipollo/release-action@v1
with:
artifacts: "redub-ubuntu-latest-x86_64,redub-ubuntu-24.04-arm-arm64,redub-macos-latest-arm64,redub-windows-latest-x86_64.exe,redub-alpine-x86_64"
allowUpdates: "true"
tag: "Build"