Skip to content

Commit

Permalink
Add GitHub action for creating releases
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusrossel committed Jan 22, 2025
1 parent a54cbbf commit 46af086
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 16 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/ci.yml
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
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
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 }}"

0 comments on commit 46af086

Please sign in to comment.