Skip to content

Commit

Permalink
Debug release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shBLOCK committed May 9, 2024
1 parent 926d074 commit 264b7ea
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ env:
GH_TOKEN: ${{ github.token }}
PIP_DISABLE_PIP_VERSION_CHECK: 1

permissions: write-all

jobs:
prep:
runs-on: windows-latest
Expand Down Expand Up @@ -148,7 +146,7 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: src_dists
name: dists_src
path: dist/

binary_dists:
Expand Down Expand Up @@ -182,26 +180,47 @@ jobs:
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: bin_dists
name: dists_bin_${{ matrix.python }}_${{ matrix.platform }}
path: dist/

github_release:
name: "GitHub Release"
runs-on: ubuntu-latest
needs: [source_dists, prep]
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: src_dists
name: dists_src
path: dist

- name: Remove Prior Release
run: gh release delete "${{ needs.prep.outputs.tag }}"
continue-on-error: true
uses: actions/github-script@v7
env:
TAG_NAME: ${{ needs.prep.outputs.tag }}
with:
# noinspection TypeScriptUnresolvedReference
script: |
const tag = process.env.TAG_NAME
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag
})
if (release.id == undefined) { // Not found
core.info(`No release with tag ${tag}.`)
} else {
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id
})
core.notice(`Deleted prior github release: ${tag}`)
}
- name: Create Release
run: gh release create "${{ needs.prep.outputs.tag }}" --verify-tag --title "${{ needs.prep.outputs.tag }}" --notes "${{ needs.prep.outputs.message }}" --draft
Expand All @@ -228,7 +247,7 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
pattern: "*dists"
pattern: "dists*"
path: dist
merge-multiple: true

Expand Down

0 comments on commit 264b7ea

Please sign in to comment.