Skip to content

Commit 181847a

Browse files
committed
updated resources/README.md for service installation documentation. updated release GHA workflow to create a release when a tag is pushed, and added pre-release.yaml to do the same for prereleases
1 parent bed3fc2 commit 181847a

3 files changed

Lines changed: 116 additions & 7 deletions

File tree

.github/workflows/pre-release.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on:
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
7+
permissions:
8+
contents: write
9+
packages: write
10+
11+
jobs:
12+
create-github-release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@master
18+
- name: Create Release
19+
id: create_release
20+
uses: actions/create-release@latest
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: Release ${{ github.ref }}
26+
body: |
27+
Changes in this Release
28+
- First Change
29+
- Second Change
30+
draft: false
31+
prerelease: false
32+
33+
releases-matrix:
34+
name: Release Go Binary
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
# build and publish in parallel: "darwin/amd64","freebsd/amd64","freebsd/arm64","freebsd/arm","linux/amd64","linux/arm","linux/arm64","openbsd/amd64","openbsd/arm64","openbsd/arm","windows/amd64"
39+
goos: [linux, windows, darwin, freebsd, openbsd]
40+
goarch: [amd64, arm64, arm]
41+
exclude:
42+
- goarch: arm64
43+
goos: windows
44+
- goarch: arm
45+
goos: windows
46+
- goarch: arm64
47+
goos: darwin
48+
- goarch: arm
49+
goos: darwin
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: wangyoucao577/go-release-action@v1
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
goos: ${{ matrix.goos }}
56+
goarch: ${{ matrix.goarch }}
57+
goarm: 7
58+
goversion: "1.21.1"
59+
#binary_name: "plex_monitor-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix-goarch }}"
60+
extra_files: LICENSE README.md
61+
compress_assets: auto

.github/workflows/release.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
1-
# .github/workflows/release.yaml
2-
31
on:
4-
release:
5-
types: [created]
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
66

77
permissions:
88
contents: write
99
packages: write
1010

1111
jobs:
12+
create-github-release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@master
18+
- name: Create Release
19+
id: create_release
20+
uses: actions/create-release@latest
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: Release ${{ github.ref }}
26+
body: |
27+
Changes in this Release
28+
- First Change
29+
- Second Change
30+
draft: false
31+
prerelease: false
32+
1233
releases-matrix:
1334
name: Release Go Binary
1435
runs-on: ubuntu-latest
@@ -33,6 +54,8 @@ jobs:
3354
github_token: ${{ secrets.GITHUB_TOKEN }}
3455
goos: ${{ matrix.goos }}
3556
goarch: ${{ matrix.goarch }}
36-
goversion: "https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz"
37-
binary_name: "test-binary"
38-
extra_files: LICENSE README.md
57+
goarm: 7
58+
goversion: "1.21.1"
59+
#binary_name: "plex_monitor-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix-goarch }}"
60+
extra_files: LICENSE README.md
61+
compress_assets: auto

resources/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Installing as a service
2+
3+
The systemd unit file `plex_monitor.service` should suffice as a functional service for most use cases.
4+
5+
Simply copy the file to `/etc/systemd/system/` and, after, updating the binary and config file locations for `ExecStart`, start the service.
6+
7+
Service logs will be written to `/var/log/plex_monitor.log`.
8+
9+
Manage the service with typical `systemctl` commands.
10+
11+
```
12+
bwhitehead@log01:~$ sudo systemctl status plex_monitor.service
13+
● plex_monitor.service - Plex Monitor
14+
Loaded: loaded (/etc/systemd/system/plex_monitor.service; enabled; vendor preset: enabled)
15+
Active: active (running) since Wed 2023-10-04 15:26:49 UTC; 2s ago
16+
Docs: https://github.com/bwhitehead0/plex_monitor
17+
Main PID: 24271 (plex_monitor)
18+
Tasks: 8 (limit: 9347)
19+
Memory: 1.3M
20+
CPU: 9ms
21+
CGroup: /system.slice/plex_monitor.service
22+
└─24271 /usr/local/bin/plex_monitor --config.file=/etc/plex_monitor.yaml
23+
24+
Oct 04 15:26:49 log01.fw.home systemd[1]: Started Plex Monitor.
25+
```

0 commit comments

Comments
 (0)