-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 changed file
with
61 additions
and
0 deletions.
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,61 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get tag name | ||
id: tag | ||
run: | | ||
tag=$(basename "${{ github.ref }}") | ||
echo "tag=$tag" >> $GITHUB_OUTPUT | ||
- name: Create release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
GH_REPO: ${{ github.repository }} | ||
run: | | ||
tag="${{ steps.tag.outputs.tag }}" | ||
echo "Tag: $tag" | ||
gh release create "$tag" --title "$tag" | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
needs: [release] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Get platform | ||
id: platform | ||
shell: bash | ||
run: | | ||
os=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]') | ||
arch=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]') | ||
platform="$arch-$os" | ||
echo "Platform: $platform" | ||
echo "platform=$platform" >> $GITHUB_OUTPUT | ||
- uses: actions/checkout@v3 | ||
- name: Set up Haskell and Stack | ||
uses: haskell/actions/setup@v2 | ||
with: | ||
enable-stack: true | ||
stack-version: 'latest' | ||
- name: Build | ||
run: stack install --local-bin-path bin | ||
- name: Archive and upload | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
GH_REPO: ${{ github.repository }} | ||
shell: bash | ||
run: | | ||
tag="${{ steps.platform.outputs.platform }}" | ||
archivename="curry-language-server-$platform.zip" | ||
zip -r "$archivename" bin | ||
gh release upload "${{ needs.release.outputs.tag }}" "$archivename" |