-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (34 loc) · 1.05 KB
/
bump-nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Bump Nix
on:
push:
tags:
- 'v-test'
jobs:
update-flake:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Nix
run: |
curl -L https://nixos.org/nix/install | sh
export PATH=$PATH:/home/runner/.nix-profile/bin
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Update version
run: |
sed -i 's/version = "[^"]*";/version = "${{ env.VERSION }}";/' flake.nix
- name: Update flake.lock
run: |
nix --version
nix flake update
- name: Commit & Push
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add flake.lock flake.nix
git commit -m 'bump nix to ${{ env.VERSION }}'
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}