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 0f7af6f
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions .github/workflows/release-upload.yaml
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,19 @@ 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"
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 +140,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 +158,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 0f7af6f

Please sign in to comment.