-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action for creating releases
- Loading branch information
1 parent
a54cbbf
commit 46af086
Showing
2 changed files
with
56 additions
and
16 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 |
---|---|---|
@@ -1,33 +1,25 @@ | ||
name: build & test | ||
name: Build and Test | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
merge_group: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
name: build and test code | ||
build-and-test: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install elan | ||
run: | | ||
set -o pipefail | ||
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain none -y | ||
~/.elan/bin/lean --version | ||
"$HOME/.elan/bin/lean" --version | ||
echo "$HOME/.elan/bin" >> $GITHUB_PATH | ||
- name: Compile Library | ||
run: | | ||
lake build | ||
- name: Build Library | ||
run: lake build | ||
- name: Run Tests | ||
run: | | ||
lake test -- ci | ||
run: lake test -- ci |
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,48 @@ | ||
name: Create Release | ||
on: | ||
# Allows this workflow to be run manually from the "Actions" tab. | ||
workflow_dispatch: | ||
inputs: | ||
release-tag: | ||
type: string | ||
description: Release Tag | ||
|
||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: "${{ github.event.inputs.release-tag }}" | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Create Tag and Release | ||
run: | | ||
git tag "$TAG" | ||
git push origin "$TAG" | ||
gh release create "$TAG" --repo="$GITHUB_REPOSITORY" --title="$TAG" | ||
upload-artifacts: | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow#about-matrix-strategies | ||
strategy: | ||
matrix: | ||
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#standard-github-hosted-runners-for-public-repositories | ||
os: [macos-latest, macos-13, ubuntu-24.04-arm, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Install elan | ||
run: | | ||
set -o pipefail | ||
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain none -y | ||
"$HOME/.elan/bin/lean" --version | ||
echo "$HOME/.elan/bin" >> $GITHUB_PATH | ||
- name: Build Library | ||
run: lake build | ||
- name: Upload Artifacts | ||
run: lake upload "${{ github.event.inputs.release-tag }}" |