Compare commits

...

6 Commits

Author SHA1 Message Date
Sven Vogel 6695c5e204 ci: tag release commit
Build'n check / run-ci-linux (push) Has been skipped Details
Build'n check / run-ci-linux (pull_request) Successful in 2m39s Details
Build'n check / Check Template and Build example (pull_request) Failing after 2m32s Details
Build'n check / release (pull_request) Has been skipped Details
2024-11-25 10:11:11 +01:00
Sven Vogel fe9fa2e614 ci: run release job when release message is present 2024-11-25 10:10:55 +01:00
Sven Vogel e77de7aec5 ci: run release on PR 2024-11-25 10:10:33 +01:00
Sven Vogel 1567c6212c style: fix spelling mistake in CI 2024-11-25 09:11:31 +01:00
Sven Vogel 5dece112cb ci: bump artifact actions to v4 2024-11-25 09:11:08 +01:00
Sven Vogel 4c55b9cc7f ci: draft release pipeline 2024-11-25 09:10:49 +01:00
1 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,79 @@
name: Build'n check
on:
pull_request:
branches:
- main
types:
- closed
jobs:
build:
name: Check Template and Build example
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install dependencies for Nix setup action
run: |
apt update -y
apt install sudo -y
- name: Setup Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- 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@v4
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: contains(github.event.head_commit.message, 'Release-As:')
env:
USERNAME: servostar
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Download Artifact
id: download
uses: actions/download-artifact@v4
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
- name: Tag Release Commit
run: |
echo ${{github.event.head_commit.message}} | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+' > Version.txt
echo "==> Tagging for version: $(cat Version.txt)"
git config --global credential.helper store
echo "https://${USERNAME}:${{secrets.RELEASE_TOKEN}}}@${{github.repositoryUrl}}" > ~/.git-credentials
git tag -m "Release" $(cat Version.txt)
git push ${{github.repositoryUrl}} $(cat Version.txt)
- name: Create release
id: create-release
uses: https://gitea.com/actions/release-action@main
with:
files: |-
Example.pdf
Release.txt
Version.txt
LICENSE
api_key: '${{secrets.RELEASE_TOKEN}}'