-
Notifications
You must be signed in to change notification settings - Fork 73
189 lines (166 loc) · 5.01 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Release
on:
push:
tags:
- '*.*.*'
- '!melpa-stable*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: true
matrix:
include:
# TODO: Get host platform from rustc instead of specifying it explicitly.
- os: macos-11
emacs-version: '27.2'
ext: dylib
host: x86_64-apple-darwin
- os: macos-12
emacs-version: '27.2'
ext: dylib
target: aarch64-apple-darwin
- os: ubuntu-18.04
emacs-version: '27.2'
ext: so
host: x86_64-unknown-linux-gnu
- os: windows-2019
emacs-version: '27.2'
ext: dll
host: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Set up Rust
run: |
rustup install stable
rustc -Vv
cargo -V
- name: Set up Rust's cross-build target
if: matrix.target
run: |
rustup target add ${{ matrix.target }}
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}
- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'
- uses: actions/checkout@v4
with:
submodules: true
- run: bin/setup
- run: bin/build -target "${{ matrix.target }}"
continue-on-error: true
- run: bin/inspect-binaries
continue-on-error: true
- name: Install tree-sitter CLI
if: ${{ !matrix.target }}
run: npm install -g tree-sitter-cli@0.19.3
- run: eask install-deps --dev
- run: bin/test
if: ${{ !matrix.target }}
continue-on-error: true
- run: bin/test bench
if: ${{ !matrix.target }}
- name: Rename cross-build's binary
if: matrix.target
run: |
mv core/tsc-dyn.${{ matrix.ext }} core/tsc-dyn.${{ matrix.target }}.${{ matrix.ext }}
- name: Make a target-explicit copy of native-build's binary
if: ${{ !matrix.target && matrix.host }}
shell: bash
run: |
cp core/tsc-dyn.${{ matrix.ext }} core/tsc-dyn.${{ matrix.host }}.${{ matrix.ext }}
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: tsc-dyn
path: core/tsc-dyn.*${{ matrix.ext }}
if-no-files-found: error
publish-binaries:
needs: build
runs-on: ubuntu-18.04
steps:
- uses: jcs090218/setup-emacs@master
with:
version: '27.2'
- uses: actions/checkout@v4
- name: Generate release notes
run: |
bin/dev release-notes $(git describe --tags --abbrev=0) > RELEASE-NOTES
cat RELEASE-NOTES
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: tsc-dyn
- run: ls -R
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
draft: false
body_path: RELEASE-NOTES
files: |
tsc-dyn.*
integ:
needs: publish-binaries
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
emacs-version: '27.2'
- os: ubuntu-18.04
emacs-version: '27.2'
# XXX: Fails on CI, but not locally (Windows 10) with
# :value 2 :fail-reason "did not signal an error"
# and
# (different-types 443 (tsc . 1))
#
# - os: windows-2019
# emacs-version: '27.2'
runs-on: ${{ matrix.os }}
steps:
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}
- uses: actions/checkout@v4
- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'
- run: bin/setup
- run: bin/test integ
publish-melpa:
needs: integ
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v4
- name: Set release version
run: |
echo "RELEASE_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Greenlight releasing to MELPA
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PAT }}
script: |
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/release",
sha: context.sha
})
continue-on-error: true
# We don't want this to trigger workflows, so we don't use a personal access token.
- name: Greenlight releasing to MELPA Stable
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/melpa-stable/v${{ env.RELEASE_VERSION }}",
sha: context.sha
})
continue-on-error: true