-
Notifications
You must be signed in to change notification settings - Fork 6
162 lines (146 loc) · 4.85 KB
/
Copy pathparity.yml
File metadata and controls
162 lines (146 loc) · 4.85 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Parity workflow: CI parity checks and build artifacts for PRs, pushes, schedules,
# and manual preview builds.
name: parity
on:
pull_request:
push:
branches:
- "**"
workflow_dispatch:
schedule:
- cron: "0 9 * * 1"
permissions: read-all
jobs:
parity:
runs-on: ubuntu-latest
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Checkout upstream Apprise
run: |
set -euo pipefail
upstream_version=$(sed -n 's/^var UpstreamVersion = "\([^"]*\)"/\1/p' internal/version/version.go)
if [[ -z "${upstream_version}" ]]; then
echo "UpstreamVersion not found in internal/version/version.go" >&2
exit 1
fi
target="../apprise"
if [[ -d "${target}" ]] && ([[ -d "${target}/.git" ]] || git -C "${target}" rev-parse --is-inside-work-tree >/dev/null 2>&1); then
echo "Upstream apprise repo already present at ${target}"
exit 0
fi
mkdir -p "${target}"
git -C "${target}" init
git -C "${target}" remote add origin https://github.com/caronc/apprise
if git -C "${target}" fetch --depth 1 origin "refs/tags/v${upstream_version}"; then
git -C "${target}" checkout --detach FETCH_HEAD
elif git -C "${target}" fetch --depth 1 origin "refs/tags/${upstream_version}"; then
git -C "${target}" checkout --detach FETCH_HEAD
else
echo "Upstream tag not found for version ${upstream_version}." >&2
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install parity dependencies
run: bash scripts/ci/setup_parity_env.sh
- name: Run parity tests
run: bash scripts/ci/run_parity_tests.sh
- name: Publish parity report summary
if: always()
run: |
echo "## Parity Report" >> "$GITHUB_STEP_SUMMARY"
if [[ -f reports/parity_report.md ]]; then
cat reports/parity_report.md >> "$GITHUB_STEP_SUMMARY"
else
echo "Parity report not generated." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload parity report artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: parity-report
path: |
reports/parity_report.md
reports/parity_report.json
- name: Notify Discord on scheduled parity failure
if: failure() && github.event_name == 'schedule' && env.DISCORD_WEBHOOK != ''
run: |
run_url="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
payload=$(printf '{"content":"parity cron failed for %s: %s"}' "$GITHUB_REPOSITORY" "$run_url")
curl -sS -X POST -H "Content-Type: application/json" -d "$payload" "$DISCORD_WEBHOOK"
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
ext: ""
- goos: linux
goarch: arm64
ext: ""
- goos: linux
goarch: 386
ext: ""
- goos: linux
goarch: arm
goarm: "7"
ext: ""
- goos: darwin
goarch: amd64
ext: ""
- goos: darwin
goarch: arm64
ext: ""
- goos: windows
goarch: amd64
ext: ".exe"
- goos: windows
goarch: arm64
ext: ".exe"
- goos: windows
goarch: 386
ext: ".exe"
- goos: freebsd
goarch: amd64
ext: ""
- goos: freebsd
goarch: arm64
ext: ""
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: "0"
BIN_EXT: ${{ matrix.ext }}
run: |
mkdir -p dist
if [ "$GOARCH" = "arm" ] && [ -n "$GOARM" ]; then
OUTPUT_NAME="apprise-go-${GOOS}-${GOARCH}v${GOARM}${BIN_EXT}"
else
OUTPUT_NAME="apprise-go-${GOOS}-${GOARCH}${BIN_EXT}"
fi
go build -trimpath -ldflags "-s -w" -o "dist/${OUTPUT_NAME}" ./cmd/apprise
echo "output_name=${OUTPUT_NAME}" >> $GITHUB_ENV
- name: Upload binary artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.output_name }}
path: dist/${{ env.output_name }}