2024-11-21 14:39:49 +00:00
|
|
|
name: Build'n check
|
2024-07-19 07:45:23 +00:00
|
|
|
on:
|
|
|
|
push:
|
2024-11-21 14:20:18 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2024-11-26 10:12:51 +00:00
|
|
|
tags:
|
|
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
2024-07-19 07:45:23 +00:00
|
|
|
jobs:
|
2024-11-21 14:20:18 +00:00
|
|
|
build:
|
|
|
|
name: Check Template and Build example
|
2024-07-19 07:45:23 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
2024-08-27 19:20:17 +00:00
|
|
|
- name: Setup Nix
|
|
|
|
uses: cachix/install-nix-action@v27
|
2024-07-19 07:45:23 +00:00
|
|
|
with:
|
2024-08-27 19:20:17 +00:00
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2024-11-21 14:20:18 +00:00
|
|
|
- name: Stylecheck
|
|
|
|
run: nix-shell --run "./run-fmt.sh --check src/lib.typ"
|
|
|
|
- id: build
|
|
|
|
name: Build
|
|
|
|
run: |
|
|
|
|
nix-shell --run ./run-ci.sh
|
|
|
|
- name: Upload artifact
|
|
|
|
id: artifact-upload
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: example-document
|
|
|
|
path: ${{ github.workspace }}/example.pdf
|
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 1
|
|
|
|
- name: Output artifact ID
|
|
|
|
run: echo 'Artifact ID is ${{ steps.artifact-upload.outputs.artifact-id }}'
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
2024-08-27 19:20:17 +00:00
|
|
|
- name: Setup go
|
2024-11-21 14:20:18 +00:00
|
|
|
uses: actions/setup-go@v4
|
2024-08-27 19:20:17 +00:00
|
|
|
with:
|
|
|
|
go-version: '>=1.20.1'
|
2024-11-21 14:20:18 +00:00
|
|
|
- name: Download Artifcat
|
|
|
|
id: download
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: example-document
|
|
|
|
path: ${{ github.workspace }}/Example.pdf
|
|
|
|
- name: 'Artifact Download Path'
|
|
|
|
run: echo ${{ steps.download.outputs.download-path }}
|
|
|
|
- name: Prepare Release
|
|
|
|
run: echo ${{ github.sha }} > Release.txt
|
2024-11-21 14:45:30 +00:00
|
|
|
- name: Release
|
2024-11-21 14:20:18 +00:00
|
|
|
uses: softprops/action-gh-release@v2
|
2024-07-19 07:45:23 +00:00
|
|
|
with:
|
2024-11-21 14:20:18 +00:00
|
|
|
files: |
|
|
|
|
Example.pdf
|
|
|
|
Release.txt
|
|
|
|
LICENSE
|