From 572d505701482d99a8f6a0ef3784338eeb4a6fc7 Mon Sep 17 00:00:00 2001 From: servostar Date: Tue, 27 Aug 2024 21:20:17 +0200 Subject: [PATCH] added nix pipeline to github --- .github/workflows/ci.yml | 16 ++++++------- .github/workflows/release.yml | 42 ++++++++++++++++++----------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a59f83..5ec21c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,16 +5,16 @@ on: [push] jobs: run-ci-linux: runs-on: ubuntu-latest - env: - TYPST_INSTALL: $HOME/.typst - TYPST_VERSION: 0.11.1 steps: - name: Check out repository code uses: actions/checkout@v3 - - name: Install Typst CLI - run: curl -fsSL https://typst.community/typst-install/install.sh | sh -s "$TYPST_VERSION" - - uses: actions/setup-python@v5 + - 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: - python-version: '3.11' + nix_path: nixpkgs=channel:nixos-unstable - name: Run CI - run: export PATH="$TYPST_INSTALL/bin:$PATH" && bash -c ./run-ci.sh + run: nix-shell --run ./run-ci.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acb4f20..f2f6809 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,32 +1,34 @@ +name: release + on: push: - # Sequence of patterns matched against refs/tags tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - -name: Create Release + - 'v*.*.*' jobs: - build: - name: Create Release + release: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v3 - - name: Install Typst CLI - run: curl -fsSL https://typst.community/typst-install/install.sh | sh -s "$TYPST_VERSION" - - uses: actions/setup-python@v5 + - 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: - python-version: '3.11' + nix_path: nixpkgs=channel:nixos-unstable - name: Run CI - run: export PATH="$TYPST_INSTALL/bin:$PATH" && bash -c ./run-ci.sh - - name: Create Release - id: create_release - uses: actions/create-release@latest - env: - GITHUB_TOKEN: ${{ secrets.PAT }} + run: nix-shell --run ./run-ci.sh + - name: Setup go + uses: https://github.com/actions/setup-go@v4 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false \ No newline at end of file + go-version: '>=1.20.1' + - name: Create release + id: create-release + uses: https://gitea.com/actions/release-action@main + with: + files: |- + example.pdf + api_key: '${{secrets.RELEASE_TOKEN}}'