Skip to content

0.0.2b1

0.0.2b1 #7

Workflow file for this run

name: "Release"
on:
release:
types: [published]
env:
name: "brew-python-resources"
download-url: "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/brew_python_resources-${{ github.ref_name }}.tar.gz"
jobs:
pyinstaller:
name: "PyInstaller"
if: ${{ !github.event.release.prerelease }}
uses: ./.github/workflows/pyinstaller.yaml
secrets: inherit
with:
version: ${{ github.ref_name }}
permissions:
contents: write
#snapcraft:
# name: "Snapcraft"
# if: ${{ !github.event.release.prerelease }}
# uses: ./.github/workflows/snapcraft.yaml
# secrets: inherit
# with:
# version: ${{ github.ref_name }}
# permissions:
# contents: write
build:
name: "Build"
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
version: ${{ github.ref_name }}
permissions:
contents: write
publish:
name: "Publish"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
permissions:
contents: write
id-token: write
environment:
name: "pypi"
url: "https://pypi.org/p/brew-python-resources"
steps:
- name: "Debug"
run: |
echo "github.ref_name: ${{ github.ref_name }}"
echo "env.name: ${{ env.name }}"
- name: "Download Artifact"
uses: actions/download-artifact@v6
with:
name: "dist"
path: "dist"
- name: "Verify Artifact"
env:
path: "dist"
name: ${{ env.name }}
tag: ${{ github.ref_name }}
run: |
ls -lAh "${path}"/*
results="$(ls -lAh "${path}"/* | awk '{print $9" - "$5}')"
md="Artifacts:\n\`\`\`text\n${results}\n\`\`\`"
echo -e "${md}" >> "$GITHUB_STEP_SUMMARY"
echo "Verification String: '${name//-/_}-${tag}-'"
find "${path}" -type f | grep -- "${name//-/_}-${tag}-" > /dev/null
- name: "Publish to PyPI"
id: publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
#attestations: false
- name: "Summary"
if: ${{ always() }}
env:
tag: ${{ github.ref_name }}
url: ${{ env.url }}
run: |
if [ "${{ steps.publish.outcome }}" == "success" ];then
md="🎉 Published Version: \`${tag}\`\n\n[${url}](${url})\n\n"
else
md="⛔ Error Publishing Version: \`${tag}\`\n\n"
fi
echo -e "${md}" >> "$GITHUB_STEP_SUMMARY"
- name: "Send Notification"
if: ${{ !cancelled() }}
uses: sarisia/actions-status-discord@b8381b25576cb341b2af39926ab42c5056cc44ed # v1.15.5
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: |
- ${{ format('https://pypi.org/p/{0}/{1}', env.name, github.ref_name) }}
- ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
homebrew:
name: "Homebrew"
if: ${{ !github.event.release.prerelease }}
uses: ./.github/workflows/homebrew.yaml
needs: [publish]
secrets: inherit
with:
name: "brew-python-resources"
version: ${{ github.ref_name }}
permissions:
contents: read
release:
name: "Release"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [publish]
permissions:
contents: write
steps:
- name: "Debug event.json"
continue-on-error: true
run: cat "${GITHUB_EVENT_PATH}"
- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"
- name: "Debug Environment"
continue-on-error: true
run: env
- name: "Debug"
continue-on-error: true
run: |
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.release.prerelease: ${{ github.event.release.prerelease }}"
- name: "Update Release Notes Action"
continue-on-error: true
uses: smashedr/update-release-notes-action@master
with:
location: tail
pypi: |
name: ${{ env.name }}
prerelease: ${{ github.event.release.prerelease }}
- name: "Send Failure Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@b8381b25576cb341b2af39926ab42c5056cc44ed # v1.15.5
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}