Skip to content

Commit ed4c6b6

Browse files
authored
CD for Ubuntu/macOS/Windows
1 parent c3b5423 commit ed4c6b6

File tree

5 files changed

+154
-0
lines changed

5 files changed

+154
-0
lines changed

.github/workflows/cd-macos-11.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Package on macOS 11
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
macosbuild:
11+
runs-on: macos-11
12+
steps:
13+
- uses: xmake-io/github-action-setup-xmake@v1
14+
with:
15+
xmake-version: v2.8.5
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 1
19+
- name: config
20+
run: xmake config --yes -vD
21+
- name: build
22+
run: xmake build --yes -vD s7
23+
- name: install
24+
run: xmake install --yes -vD s7
25+
- name: Upload
26+
uses: actions/upload-artifact@v3
27+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
28+
with:
29+
path: build/s7_*
30+
- name: Release
31+
uses: softprops/action-gh-release@v1
32+
if: startsWith(github.ref, 'refs/tags/')
33+
with:
34+
prerelease: true
35+
files: build/s7_*

.github/workflows/cd-macos-arm64.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Packaging on macOS arm64
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
macosbuild:
11+
strategy:
12+
matrix:
13+
os: [macos-12]
14+
arch: [arm64]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: xmake-io/github-action-setup-xmake@v1
18+
with:
19+
xmake-version: v2.8.5
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 1
23+
- name: config
24+
run: xmake config --yes -vD
25+
- name: build
26+
run: xmake build --yes -vD s7
27+
- name: install
28+
run: xmake install --yes -vD s7
29+
- name: Upload
30+
uses: actions/upload-artifact@v3
31+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
32+
with:
33+
path: build/s7_*
34+
- name: Release
35+
uses: softprops/action-gh-release@v1
36+
if: startsWith(github.ref, 'refs/tags/')
37+
with:
38+
prerelease: true
39+
files: build/s7_*

.github/workflows/cd-ubuntu-jammy.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Packaging on Ubuntu 22.04
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
linuxbuild:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: xmake-io/github-action-setup-xmake@v1
14+
with:
15+
xmake-version: v2.8.5
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 1
19+
- name: config
20+
run: xmake config --yes -vD
21+
- name: build
22+
run: xmake build --yes -vD s7
23+
- name: install
24+
run: xmake install --yes -vD s7
25+
- name: Upload
26+
uses: actions/upload-artifact@v3
27+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
28+
with:
29+
path: build/s7_*
30+
- name: Release
31+
uses: softprops/action-gh-release@v1
32+
if: startsWith(github.ref, 'refs/tags/')
33+
with:
34+
prerelease: true
35+
files: build/s7_*

.github/workflows/cd-windows.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Packaging on Windows
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
windowsbuild:
11+
runs-on: windows-2019
12+
steps:
13+
- uses: xmake-io/github-action-setup-xmake@v1
14+
with:
15+
xmake-version: v2.8.5
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 1
19+
- name: config
20+
run: xmake config --yes -vD
21+
- name: build
22+
run: xmake build --yes -vD s7
23+
- name: install
24+
run: xmake install --yes -vD s7
25+
- name: Upload
26+
uses: actions/upload-artifact@v3
27+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
28+
with:
29+
path: build/s7_*
30+
- name: Release
31+
uses: softprops/action-gh-release@v1
32+
if: startsWith(github.ref, 'refs/tags/')
33+
with:
34+
prerelease: true
35+
files: build/s7_*
36+

xmake.lua

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ add_requires("s7 "..S7_VERSION, {system=false})
2121
target("s7") do
2222
add_packages ("s7")
2323
add_files("repl.c")
24+
on_install(function (target)
25+
if is_plat("linux", "macosx") then
26+
os.cp("$(buildir)/$(plat)/$(arch)/$(mode)/s7", "$(buildir)/s7_$(plat)_$(arch)")
27+
elseif is_plat("windows") then
28+
os.cp("$(buildir)/$(plat)/$(arch)/$(mode)/s7.exe", "$(buildir)/s7_$(plat)_$(arch).exe")
29+
else
30+
print("Unsupported platform!!!")
31+
end
32+
end)
2433
end
2534

2635
target("plus.scm") do

0 commit comments

Comments
 (0)