Skip to content

Commit

Permalink
use GITHUB_OUTPUT and raspiblitz org
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Jan 19, 2024
1 parent 480e33b commit c2e172b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/test-amd64-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,37 @@ jobs:
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then
echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}"
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)"
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display values
run: |
echo "BUILD_DATE: ${{env.BUILD_DATE}}"
echo "BUILD_VERSION: ${{env.BUILD_VERSION}}"
echo "BRANCH_NAME: ${{env.BRANCH_NAME}}"
echo "GITHUB_USER: ${{steps.set_values.outputs.github_user}}"
echo "GITHUB_USER: ${{steps.set_values.outputs.GITHUB_USER}}"
- name: Get Last Successful Workflow Run ID
id: get-run-id
run: |
RUN_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml/runs?branch=dev&status=success" \
"https://api.github.com/repos/raspiblitz/raspiblitz/actions/workflows/amd64-lean-image.yml/runs?branch=dev&status=success" \
| jq -r '.workflow_runs[0].id')
echo "::set-output name=run_id::$RUN_ID"
echo "RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT
- name: Get Artifact Download URL
id: get-artifact-url
run: |
ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/rootzoll/raspiblitz/actions/runs/${{ steps.get-run-id.outputs.run_id }}/artifacts" \
"https://api.github.com/repos/raspiblitz/raspiblitz/actions/runs/${{ steps.get-run-id.outputs.RUN_ID }}/artifacts" \
| jq -r '.artifacts[0].archive_download_url')
echo "::set-output name=url::$ARTIFACT_URL"
echo "ARTIFACT_URL=$ARTIFACT_URL" >> $GITHUB_OUTPUT
- name: Download Artifact
run: |
curl -L -o artifact.zip -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ steps.get-artifact-url.outputs.url }}
curl -L -o artifact.zip -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ steps.get-artifact-url.outputs.ARTIFACT_URL }}
- name: Decompress Image
run: |
Expand All @@ -76,6 +76,6 @@ jobs:
- name: Run the build script
run: |
echo "Using the variables: --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.value}} --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}}
echo "Using the variables: --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.value}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}
cd ci/amd64
bash packer.build.amd64-debian.sh --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.value}} --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}}
bash packer.build.amd64-debian.sh --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.value}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}

0 comments on commit c2e172b

Please sign in to comment.