test fix bump-nix #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
sudo apt update | |
sudo apt install -y nix-env | |
- 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 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 }} |