Skip to content

Commit 325b83c

Browse files
committed
ci: Publish bundles tree-sitter-grammars.<platform>.<version>.tar.gz
1 parent be048aa commit 325b83c

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,27 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17+
# TODO: Get host platform from somewher instead of specifying it explicitly here.
1718
- os: macos-10.15
18-
bundle_target: macos
19+
bundle_os: macos
1920
emacs-version: '27.2'
2021
ext: dylib
22+
host: x86_64-apple-darwin
23+
- os: macos-11
24+
bundle_os: macos
25+
emacs-version: '27.2'
26+
ext: dylib
27+
target: aarch64-apple-darwin
2128
- os: ubuntu-18.04
22-
bundle_target: linux
29+
bundle_os: linux
2330
emacs-version: '27.2'
2431
ext: so
32+
host: x86_64-unknown-linux-gnu
2533
- os: windows-2019
26-
bundle_target: windows
34+
bundle_os: windows
2735
emacs-version: '27.2'
2836
ext: dll
37+
host: x86_64-pc-windows-msvc
2938
runs-on: ${{ matrix.os }}
3039
steps:
3140
- uses: actions/checkout@v2
@@ -53,13 +62,15 @@ jobs:
5362
- run: .github/script/setup-cask
5463
- run: cask install
5564

56-
- run: script/compile all
57-
continue-on-error: true
65+
- run: script/compile all -target "${{ matrix.target }}"
66+
continue-on-error: ${{ !matrix.target }}
5867

5968
- run: script/inspect-binaries
6069
continue-on-error: true
6170
- run: script/test
71+
if: ${{ !matrix.target }}
6272
- run: cask package
73+
if: ${{ !matrix.target }}
6374

6475
- name: Determine version
6576
if: runner.os != 'Windows'
@@ -71,11 +82,21 @@ jobs:
7182
$bundle_version = ((script/bundle-version) | Out-String).Trim()
7283
echo BUNDLE_VERSION=$bundle_version | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7384
85+
- name: Rename cross-compilation's binary
86+
if: matrix.target
87+
run: |
88+
mv tree-sitter-grammars-${{ matrix.bundle_os }}-${{ env.BUNDLE_VERSION }}.tar.gz tree-sitter-grammars.${{ matrix.target }}.v${{ env.BUNDLE_VERSION }}.tar.gz
89+
- name: Make a target-explicit copy of native compilation's binary
90+
if: ${{ !matrix.target && matrix.host }}
91+
shell: bash
92+
run: |
93+
cp tree-sitter-grammars-${{ matrix.bundle_os }}-${{ env.BUNDLE_VERSION }}.tar.gz tree-sitter-grammars.${{ matrix.host }}.v${{ env.BUNDLE_VERSION }}.tar.gz
94+
7495
- name: Upload binary
7596
uses: actions/upload-artifact@v2
7697
with:
7798
name: tree-sitter-grammars
78-
path: tree-sitter-grammars-${{ matrix.bundle_target }}-${{ env.BUNDLE_VERSION }}.tar.gz
99+
path: tree-sitter-grammars*.tar.gz
79100
if-no-files-found: error
80101

81102
publish:
@@ -104,7 +125,7 @@ jobs:
104125
with:
105126
body_path: RELEASE-NOTES
106127
files: |
107-
tree-sitter-grammars-*.tar.gz
128+
tree-sitter-grammars*.tar.gz
108129
109130
- name: Greenlight releasing to MELPA
110131
run: |

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

33
## Unreleased
4+
- Modified CI pipelines to publish additional pre-built grammar bundles. Their filenames include the platform they are built for. The files without platform in their name will eventually be deprecated.
5+
+ `tree-sitter-grammars.x86_64-apple-darwin.v<version>.tar.gz` (same as `tree-sitter-grammars-macos-<version>.tar.gz`)
6+
+ `tree-sitter-grammars.x86_64-unknown-linux-gnu.v<version>.tar.gz` (same as `tree-sitter-grammars-linux-<version>.tar.gz`)
7+
+ `tree-sitter-grammars.x86_64-pc-windows-msvc.v<version>.tar.gz` (same as `tree-sitter-grammars-windows-<version>.tar.gz`)
8+
+ `tree-sitter-grammars.aarch64-apple-darwin.v<version>.tar.gz` (new, for Apple Silicon)
49

510
## 0.10.12 - 2021-12-13
611

0 commit comments

Comments
 (0)