-
Notifications
You must be signed in to change notification settings - Fork 5
118 lines (105 loc) · 3.67 KB
/
Copy pathparity.yml
File metadata and controls
118 lines (105 loc) · 3.67 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
# Parity workflow: CI parity checks and build artifacts for PRs, pushes, schedules,
# and manual preview builds.
name: parity
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: "0 9 * * 1"
jobs:
parity:
runs-on: ubuntu-latest
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
steps:
- name: Checkout
uses: actions/checkout@v6
- 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@v6
with:
go-version-file: go.mod
- name: Set up Python
uses: actions/setup-python@v6
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: 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: darwin
goarch: amd64
ext: ""
- goos: darwin
goarch: arm64
ext: ""
- goos: windows
goarch: amd64
ext: ".exe"
- goos: windows
goarch: arm64
ext: ".exe"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
BIN_EXT: ${{ matrix.ext }}
run: |
mkdir -p dist
go build -trimpath -ldflags "-s -w" -o "dist/apprise-go-${GOOS}-${GOARCH}${BIN_EXT}" ./cmd/apprise
- name: Upload binary artifact
uses: actions/upload-artifact@v6
with:
name: apprise-go-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}
path: dist/apprise-go-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}