-
-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (113 loc) · 3.66 KB
/
release.yaml
File metadata and controls
131 lines (113 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: "Release"
on:
release:
types: [published]
env:
name: "vultr-python"
jobs:
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/vultr-python"
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@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: |
- ${{ format('https://pypi.org/p/{0}/{1}', env.name, github.ref_name) }}
- ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
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@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}