This commit is contained in:
parent
1062595d7f
commit
7619be6d11
9
.github/actions/init/action.yaml
vendored
9
.github/actions/init/action.yaml
vendored
@ -1,16 +1,13 @@
|
|||||||
name: "Initialize"
|
name: "initialize"
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: install nix
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v31
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
- name: Use Cachix
|
- name: use cachix
|
||||||
uses: cachix/cachix-action@v16
|
uses: cachix/cachix-action@v16
|
||||||
with:
|
with:
|
||||||
name: trevstack
|
name: trevstack
|
||||||
|
1
.github/workflows/check.yaml
vendored
1
.github/workflows/check.yaml
vendored
@ -15,6 +15,7 @@ jobs:
|
|||||||
contains(github.event.head_commit.message, 'bump:') == false &&
|
contains(github.event.head_commit.message, 'bump:') == false &&
|
||||||
contains(github.event.head_commit.message, 'Merge pull request') == false
|
contains(github.event.head_commit.message, 'Merge pull request') == false
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/init
|
- uses: ./.github/actions/init
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
|
19
.github/workflows/release.yaml
vendored
19
.github/workflows/release.yaml
vendored
@ -13,18 +13,20 @@ jobs:
|
|||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/init
|
- uses: ./.github/actions/init
|
||||||
|
|
||||||
- name: Check
|
- name: check
|
||||||
run: nix flake check
|
run: nix flake check
|
||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/init
|
- uses: ./.github/actions/init
|
||||||
|
|
||||||
- name: Build
|
- name: build
|
||||||
run: >
|
run: >
|
||||||
nix build
|
nix build
|
||||||
.#trevstack-linux-amd64
|
.#trevstack-linux-amd64
|
||||||
@ -34,7 +36,7 @@ jobs:
|
|||||||
.#trevstack-darwin-amd64
|
.#trevstack-darwin-amd64
|
||||||
.#trevstack-darwin-arm64
|
.#trevstack-darwin-arm64
|
||||||
|
|
||||||
- name: Release
|
- name: release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
@ -45,9 +47,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: release
|
needs: release
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/init
|
- uses: ./.github/actions/init
|
||||||
|
|
||||||
- name: Set env
|
- name: set env
|
||||||
run: |
|
run: |
|
||||||
TAG=${{ github.ref_name }}
|
TAG=${{ github.ref_name }}
|
||||||
VERSION=${TAG#v}
|
VERSION=${TAG#v}
|
||||||
@ -56,20 +59,20 @@ jobs:
|
|||||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||||
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV
|
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: login to github container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build & Load Images
|
- name: build & load images
|
||||||
run: |
|
run: |
|
||||||
nix build .#trevstack-linux-amd64-image && ./result | docker load
|
nix build .#trevstack-linux-amd64-image && ./result | docker load
|
||||||
nix build .#trevstack-linux-arm64-image && ./result | docker load
|
nix build .#trevstack-linux-arm64-image && ./result | docker load
|
||||||
nix build .#trevstack-linux-arm-image && ./result | docker load
|
nix build .#trevstack-linux-arm-image && ./result | docker load
|
||||||
|
|
||||||
- name: Push Images
|
- name: push images
|
||||||
run: |
|
run: |
|
||||||
docker image tag trevstack:$VERSION-amd64 $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
|
docker image tag trevstack:$VERSION-amd64 $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
|
||||||
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
|
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
|
||||||
@ -80,7 +83,7 @@ jobs:
|
|||||||
docker image tag trevstack:$VERSION-arm $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
|
docker image tag trevstack:$VERSION-arm $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
|
||||||
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
|
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
|
||||||
|
|
||||||
- name: Push Manifest
|
- name: push manifest
|
||||||
run: |
|
run: |
|
||||||
docker manifest create $REGISTRY/$GITHUB_REPOSITORY:$VERSION \
|
docker manifest create $REGISTRY/$GITHUB_REPOSITORY:$VERSION \
|
||||||
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 \
|
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 \
|
||||||
|
9
.github/workflows/update.yaml
vendored
9
.github/workflows/update.yaml
vendored
@ -13,18 +13,19 @@ jobs:
|
|||||||
update:
|
update:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/init
|
- uses: ./.github/actions/init
|
||||||
|
|
||||||
# https://github.com/actions/checkout/issues/13
|
# https://github.com/actions/checkout/issues/13
|
||||||
- name: Set Git Config
|
- name: set git config
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Update
|
- name: update
|
||||||
run: nix run .#update
|
run: nix run .#update
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: create pull request
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
@ -32,7 +33,7 @@ jobs:
|
|||||||
title: update
|
title: update
|
||||||
body: automatic update
|
body: automatic update
|
||||||
|
|
||||||
- name: Enable Automerge
|
- name: enable automerge
|
||||||
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
|
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.PAT }}
|
GH_TOKEN: ${{ secrets.PAT }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user