This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
fix(test11): test upgrade node version #48
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: Update node version - nix flake | |
on: | |
push: | |
branches: | |
- 'release-please--branches--master--components--clever-tools' | |
# paths: | |
# - 'package.json' | |
jobs: | |
get-major-node-version: | |
runs-on: ubuntu-latest | |
outputs: | |
nodeVersion: ${{ steps.extract_major_node_version.outputs.MAJOR_NODE_VERSION }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: get_package_json_content | |
run: | | |
{ | |
echo 'PACKAGE_JSON_CONTENT<<EOF' | |
cat ./package.json | |
echo EOF | |
} >> $GITHUB_OUTPUT | |
- id: extract_node_version | |
run: echo "NODE_VERSION=${{ fromJSON(steps.get_package_json_content.outputs.PACKAGE_JSON_CONTENT).volta.node }}" >> $GITHUB_OUTPUT | |
- name: extract major node version | |
id: extract_major_node_version | |
run: | | |
echo "$(echo ${{ steps.extract_node_version.outputs.NODE_VERSION }} | sed 's/\..\+//g')" | |
echo "MAJOR_NODE_VERSION=$(echo ${{ steps.extract_node_version.outputs.NODE_VERSION }} | sed 's/\..\+//g')" >> $GITHUB_OUTPUT | |
- name: check | |
run: echo ${{ steps.extract_major_node_version.outputs.MAJOR_NODE_VERSION }} | |
update-nix-flake-node-version: | |
runs-on: ubuntu-latest | |
needs: get-major-node-version | |
steps: | |
- uses: actions/checkout@v4 | |
- name: replace nix flake node version | |
run: | | |
echo ${{ needs.get_major_node_version.outputs.MAJOR_NODE_VERSION }} | |
sed -r -i "s/(nodejs-.._x)/nodejs-${{ needs.get_major_node_version.outputs.nodeVersion }}_x/gm" flake.nix | |
- name: run git status | |
run: git status |