-
Notifications
You must be signed in to change notification settings - Fork 10
128 lines (116 loc) · 3.34 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
122
123
124
125
126
127
128
name: Binaries
on:
push:
branches:
- master
- release
tags:
- "v*"
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- os: linux
triple: x86_64-linux-musl
name: linux_x64
nimbleName: linux_x64
- os: linux
triple: i686-linux-musl
name: linux_x32
nimbleName: linux_x32
- os: linux
triple: aarch64-linux-musl
name: linux_arm64
nimbleName: linux_aarch64
- os: linux
triple: armv7l-linux-musleabihf
name: linux_armv7l
nimbleName: linux_armv7l
- os: macosx
triple: x86_64-apple-darwin14
name: macosx_x64
nimbleName: macosx_x64
- os: windows
triple: x86_64-w64-mingw32
name: windows_x64
nimbleName: windows_x64
include:
- target:
os: linux
builder: ubuntu-20.04
- target:
os: macosx
builder: macos-12
- target:
os: windows
builder: windows-2019
defaults:
run:
shell: bash
name: Release '${{ matrix.target.name }}'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch nimble
uses: robinraju/release-downloader@v1.8
with:
repository: "nim-lang/nimble"
tag: "latest"
fileName: "nimble-${{matrix.target.nimbleName}}.tar.gz"
extract: false
- name: Setup env
run: |
# extract: true doesn't work on osx :/
tar xvf nimble-${{matrix.target.nimbleName}}.tar.gz
# needed for nimble on windows
curl -L "https://curl.se/ca/cacert.pem" -o cacert.pem
echo "$PWD" >> $GITHUB_PATH
- uses: jiro4989/setup-nim-action@v2
with:
nim-version: '2.0.2' # default is 'stable'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build nph
run: |
nimble install -y
# nimble setup -l
nimble build -d:release
- name: Create archive
run: |
tar -c -z -v -f nph-${{ matrix.target.name }}.tar.gz `ls nph{,.exe} 2>/dev/null || true`
- name: Upload the binaries
uses: actions/upload-artifact@v3
with:
name: nph-${{ matrix.target.name }}.tar.gz
path: nph-${{ matrix.target.name }}.tar.gz
create-github-release:
name: Create Github Release
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artefacts
uses: actions/download-artifact@v3
- uses: ncipollo/release-action@v1
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: Continuous prerelease
artifacts: "*/*"
allowUpdates: true
prerelease: true
tag: latest
- uses: ncipollo/release-action@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
name: nph ${{github.ref}}
artifacts: "*/*"
allowUpdates: false
- name: Delete artefacts
uses: geekyeggo/delete-artifact@v2
with:
failOnError: false
name: "nph-*"