-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build and test | ||
|
||
# README: | ||
# | ||
# The semantics for running shell commands in GitHub actions is non-obvious. Please read | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell | ||
# before modifying this file. Our strategy is to rely on the built-in (unspecified) shell, and | ||
# explicitly set the shell settings we want (with `set -eo pipefail`) at the beginning of any | ||
# bash script. For more information on these settings, see `man bash`. | ||
# | ||
# GitHub Actions files can be difficult to modify with confidence, because testing changes often | ||
# requires pushing to a branch and running CI remotely. To make this process easier, consider | ||
# the following: | ||
# | ||
# 1) Use Visual Studio Code with the GitHub Actions Extension (github.vscode-github-actions). | ||
# This allows you to check the validity of your action schema and syntax without pushing to a | ||
# branch. | ||
# 2) Use https://github.com/nektos/act to run your CI steps locally. Note this will only work with | ||
# steps run on Linux platforms, as `act` is implemented with Docker containers. | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
tags: ["v*.*.*"] | ||
branches: [ main ] | ||
paths-ignore: | ||
- "Docs/**" | ||
- "**.md" | ||
- "README.md" | ||
- "LICENSE" | ||
- ".gitignore" | ||
# pull_request: | ||
# branches: [ "**" ] | ||
# paths-ignore: | ||
# - "Docs/**" | ||
# - "**.md" | ||
# - "README.md" | ||
# - "LICENSE" | ||
# - ".gitignore" | ||
|
||
jobs: | ||
package-vscode-extension: | ||
name: "Package VSCode extension" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
host: [ | ||
{ | ||
type: linux, os: ubuntu-latest, | ||
} | ||
] | ||
|
||
runs-on: ${{ matrix.host.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- uses: robinraju/[email protected] | ||
with: | ||
# The source repository path. | ||
# Expected format {owner}/{repo} | ||
# Default: ${{ github.repository }} | ||
repository: koliyo/hylo-lsp | ||
latest: ${{ github.ref == 'refs/heads/main' && 'true' || 'false' }} | ||
tag: ${{ github.ref == 'refs/heads/main' && '' || format(github.ref_name) }} | ||
extract: false | ||
out-file-path: hylo-lsp-artifacts | ||
|
||
- name: Package VSCode extension | ||
run: | | ||
set -eo pipefail | ||
DIST_DIR=dist | ||
ARTIFACTS_DIR=hylo-lsp-artifacts | ||
mkdir -p $DIST_DIR | ||
rm -rf $DIST_DIR/stdlib | ||
tar -xvf $ARTIFACTS_DIR/hylo-stdlib.tar.gz | ||
tar -xvf $ARTIFACTS_DIR/hylo-lsp-mac.tar.gz | ||
mv hylo-stdlib $DIST_DIR/stdlib | ||
mkdir -p $DIST_DIR/bin/mac/arm64 | ||
mv hylo-lsp-mac/hylo-lsp-server $DIST_DIR/bin/mac/arm64/ | ||
npm install | ||
npm run vscode:package | ||
- name: Upload VSCode extension artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: vscode-extension-artifacts | ||
path: | | ||
*.vsix | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish release version | ||
|
||
on: | ||
push: | ||
tags: ["v*.*.*"] | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-and-test.yml | ||
publish-release: | ||
needs: [build] | ||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
host: [ | ||
{ | ||
type: macos, os: macos-13, | ||
build-options: "--build-tests -Xswiftc -enable-testing", | ||
# No coverage support on MacOS | ||
test-options: "-v" | ||
} | ||
] | ||
|
||
runs-on: ${{ matrix.host.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download VSCode extension artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: build-and-test.yml | ||
name: vscode-extension-artifacts | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
CHANGELOG.md | ||
LICENSE | ||
vscode-extension-artifacts/*.vsix |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ vsc-extension-quickstart.md | |
**/.eslintrc.json | ||
**/*.map | ||
**/*.ts | ||
hylo-lsp-*/** |
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