Skip to content

Commit

Permalink
temp: figure out how download-artifact works
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jun 22, 2024
1 parent fb15efa commit 108159f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ concurrency:
cancel-in-progress: true

jobs:
find-run:
name: "Find latest dist run"

publish-to-test-pypi:
name: "Publish to Test PyPI"
if: ${{ github.event.action == 'publish-testpypi' }}
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/try-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt

name: "Try Download"

on:
push:
workflow_dispatch:

defaults:
run:
shell: bash

permissions:
contents: read

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
find-run:
name: "Find latest dist run"
runs-on: "ubuntu-latest"

steps:
- name: "Find latest kit.yml run"
id: runs
uses: octokit/[email protected]
with:
route: GET /repos/nedbat/coveragepy/actions/workflows/kit.yml/runs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

try-download:
name: "Try to download artifacts"
runs-on: "ubuntu-latest"
needs:
- find-run

# https://api.github.com/repos/nedbat/coveragepy/actions/workflows/kit.yml/runs

steps:

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"

#- name: "Find latest kit.yml run"
# id: runs
# uses: octokit/[email protected]
# with:
# route: GET /repos/nedbat/coveragepy/actions/workflows/kit.yml/runs
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Download dists"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
repository: "nedbat/coveragepy"
run-id: ${{ fromJson(steps.runs.outputs.data).workflow_runs[0].id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
pattern: "dist-*"
merge-multiple: true
path: "dist/"

- name: "What did we get?"
run: |
ls -alR
echo "Number of dists:"
ls -1 dist | wc -l

0 comments on commit 108159f

Please sign in to comment.