Release #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |