Skip to content

Commit

Permalink
Release action attempt to use ci artifacts first
Browse files Browse the repository at this point in the history
  • Loading branch information
mgziminsky committed Nov 10, 2024
1 parent b9cfb85 commit 438b593
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
schedule:
- cron: "03 02 * * 06"

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

permissions:
contents: read

Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,37 @@ jobs:
changelog: cli/CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
needs: create-release
cached-assets:
needs:
- create-release
runs-on: ubuntu-latest
continue-on-error: true
permissions:
actions: read
contents: write
secrets: inherit
steps:
- id: find-id
run: |
echo -n run_id= >> $GITHUB_OUTPUT
gh api '/repos/{owner}/{repo}/actions/runs' -X GET \
-f status=success -f head_sha=${{ github.sha }} \
-q '.workflow_runs | map(select(.path == ".github/workflows/ci.yml")) | max_by(.run_started_at).id' >> $GITHUB_OUTPUT
- run: test -n '${{ steps.find-id.outputs.id }}'
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
run-id: ${{ steps.find-id.outputs.id }}
- run: gh release upload ${{ github.ref }} artifacts/*

build-assets:
if: needs.cached-assets.conclusion != 'success'
uses: ./.github/workflows/build.yml
with:
dry-run: false
permissions:
contents: write
secrets: inherit
needs:
- create-release
- cached-assets

0 comments on commit 438b593

Please sign in to comment.