ci: run build on mr and use release from template
This commit was merged in pull request #34.
This commit is contained in:
34
.gitea/workflows/build-flake.yml
Normal file
34
.gitea/workflows/build-flake.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: build-flake
|
||||
on:
|
||||
workflow_call:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: "main"
|
||||
- name: Setup sudo (required for the next step)
|
||||
run: apt-get update && apt-get install -y sudo
|
||||
- name: Setup nix
|
||||
uses: cachix/install-nix-action@v30
|
||||
with:
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
github_access_token: ${{ secrets.GH_ACCESS_TOKEN }}
|
||||
nix_path: nixpkgs=channel:nixos-24.05
|
||||
- uses: cachix/cachix-action@v15
|
||||
with:
|
||||
name: palkx
|
||||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
extraPullNames: nix-community
|
||||
- name: Build nix flake
|
||||
run: |
|
||||
while true; do sleep 1; rm -rf /homeless-shelter; done &
|
||||
nix build
|
||||
- name: Check nix flake
|
||||
run: nix flake check --all-systems
|
||||
@@ -1,66 +0,0 @@
|
||||
name: check-flake
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: "main"
|
||||
- name: Setup sudo (required for the next step)
|
||||
run: apt-get update && apt-get install -y sudo
|
||||
- name: Setup nix
|
||||
uses: cachix/install-nix-action@v30
|
||||
with:
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
github_access_token: ${{ secrets.GH_ACCESS_TOKEN }}
|
||||
nix_path: nixpkgs=channel:nixos-24.05
|
||||
- uses: cachix/cachix-action@v15
|
||||
with:
|
||||
name: palkx
|
||||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
extraPullNames: nix-community
|
||||
- name: Build nix flake
|
||||
run: |
|
||||
while true; do sleep 1; rm -rf /homeless-shelter; done &
|
||||
nix build
|
||||
- name: Check nix flake
|
||||
run: nix flake check --all-systems
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: |
|
||||
git config user.name gitea-bot
|
||||
git config user.email bot@git.palkoi.net
|
||||
git config --global user.email bot@git.palkoi.net
|
||||
git config --global user.name gitea-bot
|
||||
|
||||
- name: Semver release
|
||||
uses: cocogitto/cocogitto-action@v3
|
||||
id: release
|
||||
with:
|
||||
release: true
|
||||
git-user: "gitea-bot"
|
||||
git-user-email: "bot@git.palkoi.net"
|
||||
check-latest-tag-only: true
|
||||
|
||||
- name: Generate Changelog
|
||||
run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md
|
||||
|
||||
- name: Upload github release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body_path: GITHUB_CHANGELOG.md
|
||||
tag_name: ${{ steps.release.outputs.version }}
|
||||
15
.gitea/workflows/release.yml
Normal file
15
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: build-flake
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build flake
|
||||
uses: ./.gitea/workflows/build-flake.yml
|
||||
release:
|
||||
name: Release a new version
|
||||
needs: build
|
||||
uses: xaked/actions/.gitea/workflows/release.yml@main
|
||||
Reference in New Issue
Block a user