Skip to content

Commit 9ad5b69

Browse files
committed
chore: run yq from nix
1 parent 8661b1d commit 9ad5b69

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/ami-release-nix.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
- name: Checkout Repo
2222
uses: actions/checkout@v3
2323

24-
- name: Install yq
24+
- uses: DeterminateSystems/nix-installer-action@main
25+
26+
- name: Install yq via Nix
2527
run: |
26-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
27-
sudo chmod a+x /usr/local/bin/yq
28-
echo "PATH=/usr/local/bin:$PATH" >> $GITHUB_ENV
28+
echo "PATH=$HOME/.nix-profile/bin:$PATH" >> $GITHUB_ENV
2929
3030
- name: Set PostgreSQL versions
3131
id: set-versions
3232
run: |
33-
VERSIONS=$(yq eval '.postgres_major[]' ansible/vars.yml | jq -R -s -c 'split("\n")[:-1]')
33+
VERSIONS=$(nix run nixpkgs#yq -- eval '.postgres_major[]' ansible/vars.yml | jq -R -s -c 'split("\n")[:-1]')
3434
echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
3535
3636
build:
@@ -55,16 +55,16 @@ jobs:
5555
- name: Checkout Repo
5656
uses: actions/checkout@v3
5757

58-
- name: Install yq
58+
- uses: DeterminateSystems/nix-installer-action@main
59+
60+
- name: Install yq via Nix
5961
run: |
60-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
61-
sudo chmod a+x /usr/local/bin/yq
62-
echo "PATH=/usr/local/bin:$PATH" >> $GITHUB_ENV
62+
echo "PATH=$HOME/.nix-profile/bin:$PATH" >> $GITHUB_ENV
6363
6464
- name: Run checks if triggered manually
6565
if: ${{ github.event_name == 'workflow_dispatch' }}
6666
run: |
67-
SUFFIX=$(yq eval '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/')
67+
SUFFIX=$(nix run nixpkgs#yq -- eval '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/')
6868
if [[ -z $SUFFIX ]] ; then
6969
echo "Version must include non-numeric characters if built manually."
7070
exit 1
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Generate common-nix.vars.pkr.hcl
7777
run: |
78-
PG_VERSION=$(yq eval '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml)
78+
PG_VERSION=$(nix run nixpkgs#yq -- eval '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml)
7979
echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl
8080
8181
- name: Build AMI stage 1

0 commit comments

Comments
 (0)