-
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.69 KB
/
release.yml
File metadata and controls
68 lines (58 loc) · 1.69 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Version Tag (e.g. v1.5.5)"
required: false
default: ""
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Extract Release Notes
id: extract_notes
uses: ffurrer2/extract-release-notes@v3
with:
changelog_file: CHANGELOG.md
- name: Validate release artifacts
run: |
set -euo pipefail
artifacts=(
"GiveawayBot.cs"
"CHANGELOG.md"
)
for artifact in "${artifacts[@]}"; do
if [[ ! -f "$artifact" ]]; then
echo "::error::Release artifact '$artifact' is missing. Update .github/workflows/release.yml before tagging a release."
exit 1
fi
done
- name: Calculate Checksum
id: shasum
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "sha=$(Get-FileHash GiveawayBot.cs -Algorithm SHA256).Hash.ToLower()" >> $GITHUB_OUTPUT
else
echo "sha=$(sha256sum GiveawayBot.cs | awk '{print $1}')" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body: |
${{ steps.extract_notes.outputs.release_notes }}
SHA256: ${{ steps.shasum.outputs.sha }}
---
**Full Documentation**: https://github.com/Sythsaz/Giveaway-Bot/wiki
files: |
GiveawayBot.cs
CHANGELOG.md