-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (134 loc) · 4.75 KB
/
make.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
name: Make CI/CD
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
releaseName:
description: The GitHub release name
default: Nightly
required: true
type: string
releaseTagName:
description: The GitHub tag name to be created/updated
default: "nightly"
required: true
type: string
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
defaults:
run:
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v3
- name: Configure to use MinGW-w64 (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++
- name: Download Adept Latest Standalone (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
curl -o Windows-x86_64-Standalone-Adept-nightly.zip -L https://github.com/AdeptLanguage/Adept/releases/download/Nightly/Windows-x86_64-Standalone-Adept-nightly.zip
7z x Windows-x86_64-Standalone-Adept-nightly.zip
echo "${{github.workspace}}\adept-nightly-standalone" >> $GITHUB_PATH
- name: Download Adept Latest Standalone (macOS)
if: matrix.os == 'macos-latest'
run: |
curl -o MacOS-arm64-Standalone-Adept-nightly.zip -L https://github.com/AdeptLanguage/Adept/releases/download/Nightly/MacOS-arm64-Standalone-Adept-nightly.zip
unzip MacOS-arm64-Standalone-Adept-nightly.zip
echo "${{github.workspace}}/adept-nightly-standalone" >> $GITHUB_PATH
- name: Download Adept Latest Standalone (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
curl -o Ubuntu-x86_64-Standalone-Adept-nightly.zip -L https://github.com/AdeptLanguage/Adept/releases/download/Nightly/Ubuntu-x86_64-Standalone-Adept-nightly.zip
unzip Ubuntu-x86_64-Standalone-Adept-nightly.zip
echo "${{github.workspace}}/adept-nightly-standalone" >> $GITHUB_PATH
- name: make (Windows)
if: matrix.os == 'windows-latest'
run: |
mingw32-make SHELL=cmd
mv adeptls.exe adeptls-windows.exe
- name: make (macOS)
if: matrix.os == 'macos-latest'
run: |
make
mv adeptls adeptls-macos
- name: make (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y llvm-15
make
mv adeptls adeptls-ubuntu
- name: Upload Build Artifact (Windows)
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
name: adeptls-windows
path: adeptls-windows.exe
- name: Upload Build Artifact (macOS)
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'macos-latest' }}
with:
name: adeptls-macos
path: adeptls-macos
- name: Upload Build Artifact (Ubuntu)
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: adeptls-ubuntu
path: adeptls-ubuntu
deploy:
name: Deploy
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Get workflow dispatch inputs (workflow dispatch)
if: github.event_name == 'workflow_dispatch'
shell: bash
run: |
echo 'releaseName=${{github.event.inputs.releaseName}}' >> $GITHUB_ENV
echo 'releaseTagName=v${{github.event.inputs.releaseTagName}}' >> $GITHUB_ENV
- name: Get default inputs (push / pr)
if: github.event_name != 'workflow_dispatch'
shell: bash
run: |
echo 'releaseName=Nightly' >> $GITHUB_ENV
echo 'releaseTagName=nightly' >> $GITHUB_ENV
- name: Download Build Artifact (windows-latest)
uses: actions/download-artifact@v3
with:
name: adeptls-windows
- name: Download Build Artifact (macos-latest)
uses: actions/download-artifact@v3
with:
name: adeptls-macos
- name: Download Build Artifact (ubuntu-latest)
uses: actions/download-artifact@v3
with:
name: adeptls-ubuntu
- name: Get current date
id: date
run: echo "::set-output name=date::$(date '+%B %d %Y at %l:%M %p %Z')"
- name: Release
uses: IsaacShelton/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
release: ${{env.releaseName}}
body: ${{ format('Last built on {0} - {1}', steps.date.outputs.date, github.sha) }}
tag: ${{env.releaseTagName}}
replace: true
files: >
adeptls-windows.exe
adeptls-macos
adeptls-ubuntu