Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Apr 18, 2024
1 parent 9c81a5b commit 7f78aa2
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/release-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ env:
GH_TOKEN: ${{ github.token }}

jobs:
wait-for-hydra:
name: "Wait for hydra check-runs"
wait_for_hydra:
runs-on: ubuntu-latest
outputs:
TARGET_TAG: ${{ steps.check_target_tag.TARGET_TAG }}
FLAKE_REF: ${{ steps.define_flake_ref.FLAKE_REF }}
steps:
- name: Define target tag (1/2)
if: ${{ inputs.target_tag != '' }} # If a tag was specified manually as input, use it
Expand All @@ -43,17 +45,22 @@ jobs:
echo "TARGET_TAG=$current_tag" >> "$GITHUB_ENV"
fi
- name: Check tag is defined
if: ${{ env.TARGET_TAG == '' }}
id: check_target_tag
run: |
echo "The tag to build binaries for is undefined! Either:"
echo "- This pipeline should run on a commit that has a tag"
echo "- This pipeline should be executed manually and the tag to target should be specified with the 'target_tag' input"
exit 1
if [[ "${{ env.TARGET_TAG }}" == "" ]]
then
echo "The tag to build binaries for is undefined! Either:"
echo "- This pipeline should run on a commit that has a tag"
echo "- This pipeline should be executed manually and the tag to target should be specified with the 'target_tag' input"
exit 1
fi
echo "TARGET_TAG=${{ env.TARGET_TAG }}" >> "$GITHUB_OUTPUT"
- name: Define FLAKE_REF
id: define_flake_ref
run: |
flake_ref="github:${{ github.repository }}/${{ env.TARGET_TAG }}"
echo "$flake_ref"
echo "FLAKE_REF=$flake_ref" >> "$GITHUB_ENV"
echo "FLAKE_REF=$flake_ref" >> "$GITHUB_OUTPUT"
- name: Get specific check run status
timeout-minutes: 120
run: |
Expand All @@ -74,7 +81,7 @@ jobs:
done
pull:
needs: [wait-for-hydra]
needs: [wait_for_hydra]
strategy:
matrix:
arch: [linux]
Expand All @@ -93,18 +100,20 @@ jobs:
- name: LS
run: |
ls
- uses: actions/checkout@v4
with:
fetch-depth: 0
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0

- name: LS
run: |
ls
# - name: LS
# run: |
# ls
- name: Display flake metadata
id: flake-metadata
run: |
nix flake metadata ${{ env.FLAKE_REF }}
nix flake metadata ${{ env.FLAKE_REF }} --json | jq -r '"LOCKED_URL=\(.url)"' >> "$GITHUB_ENV"
echo "${{ fromJSON(needs.wait_for_hydra.outputs }}"
nix --version
nix flake metadata "${{ needs.wait_for_hydra.outputs.FLAKE_REF }}"
nix flake metadata "${{ needs.wait_for_hydra.outputs.FLAKE_REF }}" --json | jq -r '"LOCKED_URL=\(.url)"' >> "$GITHUB_ENV"
- name: Build
run: |
case ${{ matrix.arch }} in
Expand Down Expand Up @@ -132,7 +141,7 @@ jobs:
retention-days: 1

upload-assets:
needs: [pull]
needs: [wait_for_hydra, pull]
name: "Upload Assets"
runs-on: ubuntu-latest
steps:
Expand All @@ -150,7 +159,7 @@ jobs:
uses: input-output-hk/action-gh-release@v1
with:
draft: true
tag_name: ${{ env.TARGET_TAG }}
tag_name: ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}
files: |
# TODO generalize
# cardano-cli-*-win64.zip
Expand Down

0 comments on commit 7f78aa2

Please sign in to comment.