Skip to content

Commit ea1879e

Browse files
authored
Merge pull request #3162 from jimklimov/FTY-obs
CI: Further updates for GHA/OBS recipes
2 parents c1c3d7f + 1451a3f commit ea1879e

4 files changed

Lines changed: 82 additions & 31 deletions

File tree

.github/workflows/01-make-dist.yml

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,39 +30,40 @@ jobs:
3030
# FIXME: Prepare/maintain a container image with pre-installed
3131
# NUT build/tooling prereqs (save about 3 minutes per run!)
3232
runs-on: ubuntu-latest
33-
permissions:
34-
#actions: read
35-
actions: write
36-
#contents: read
37-
contents: write
38-
repository-projects: write
39-
security-events: write
40-
pull-requests: write
41-
issues: write
33+
#permissions:
34+
# #actions: read
35+
# actions: write
36+
# #contents: read
37+
# contents: write
38+
# repository-projects: write
39+
# security-events: write
40+
# pull-requests: write
41+
# issues: write
4242

4343
strategy:
4444
fail-fast: false
4545

4646
steps:
4747
# Post early so this would be about the top comment in the PR trail
4848
# (easy to see, contents replaced later)
49-
- name: "GHA-01: Make dist and docs tarballs - report download URL - t1"
50-
uses: thollander/actions-comment-pull-request@v3
51-
# if: startsWith(github.ref, 'refs/pull/')
52-
continue-on-error: true
53-
with:
54-
comment-tag: latest-tarball
55-
message: Dist and Docs will be linked here after the "make dist" job completes.
56-
#github-token: ${{ secrets.MAKE_DIST_TOKEN }}
49+
50+
#- name: "GHA-01: Make dist and docs tarballs - report download URL - t1"
51+
# uses: thollander/actions-comment-pull-request@v3
52+
# # if: startsWith(github.ref, 'refs/pull/')
53+
# continue-on-error: true
54+
# with:
55+
# comment-tag: latest-tarball
56+
# message: Sticky note -- Dist and Docs tarballs will be linked here after the "make dist" job completes.
57+
# #github-token: ${{ secrets.MAKE_DIST_TOKEN }}
5758

5859
- name: "GHA-01: Make dist and docs tarballs - report download URL - s1"
5960
uses: marocchino/sticky-pull-request-comment@v2
60-
# if: startsWith(github.ref, 'refs/pull/')
61+
if: startsWith(github.ref, 'refs/pull/')
6162
continue-on-error: true
6263
with:
6364
header: latest-tarball-sticky
6465
only_create: true
65-
message: Dist and Docs will be linked here after the "make dist" job completes.
66+
message: Sticky note -- Dist and Docs tarballs will be linked here after the "make dist" job completes.
6667
#github-token: ${{ secrets.MAKE_DIST_TOKEN }}
6768
#GITHUB_TOKEN: ${{ secrets.MAKE_DIST_TOKEN }}
6869

@@ -73,13 +74,15 @@ jobs:
7374
fetch-tags: true
7475

7576
# https://github.com/marketplace/actions/substitute-string
77+
# https://docs.github.com/en/actions/reference/workflows-and-actions/variables
78+
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
7679
# Note it warns about "unexpected input(s)" with replacement tokens below,
7780
# as they are by design not predefined, as far as actions API is concened.
7881
# They still work for substitutions though.
7982
- uses: bluwy/substitute-string-action@v3
8083
id: subst-github-ref-name
8184
with:
82-
_input-text: "${{ github.ref_name }}"
85+
_input-text: "${{ github.head_ref || github.ref_name }}"
8386
" ": _
8487
"/": _
8588
- run: echo "${{ steps.subst-github-ref-name.outputs.result }}"
@@ -274,22 +277,30 @@ jobs:
274277
# FIXME: Something that adds/updates Github Checks would be better
275278
# as it would be seen in the list attached to a status icon of any
276279
# build (e.g. history of master branch)
277-
- name: "GHA-01: Make dist and docs tarballs - report download URL - t2"
278-
uses: thollander/actions-comment-pull-request@v3
279-
# if: startsWith(github.ref, 'refs/pull/')
280-
continue-on-error: true
281-
with:
282-
comment-tag: latest-tarball
283-
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.sha }}
284-
#github-token: ${{ secrets.MAKE_DIST_TOKEN }}
280+
281+
#- name: "GHA-01: Make dist and docs tarballs - report download URL - t2"
282+
# uses: thollander/actions-comment-pull-request@v3
283+
# # if: startsWith(github.ref, 'refs/pull/')
284+
# continue-on-error: true
285+
# with:
286+
# comment-tag: latest-tarball
287+
# message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.event.pull_request.head.sha || github.sha }}
288+
# #github-token: ${{ secrets.MAKE_DIST_TOKEN }}
285289

286290
# https://github.com/marocchino/sticky-pull-request-comment
287291
- name: "GHA-01: Make dist and docs tarballs - report download URL - s2"
288292
uses: marocchino/sticky-pull-request-comment@v2
289-
# if: startsWith(github.ref, 'refs/pull/')
293+
if: startsWith(github.ref, 'refs/pull/')
290294
continue-on-error: true
291295
with:
292296
header: latest-tarball-sticky
293-
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.sha }}
297+
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.event.pull_request.head.sha || github.sha }}
294298
#github-token: ${{ secrets.MAKE_DIST_TOKEN }}
295299
#GITHUB_TOKEN: ${{ secrets.MAKE_DIST_TOKEN }}
300+
301+
# https://github.com/marketplace/actions/commit-comment
302+
- name: "GHA-01: Make dist and docs tarballs - report download URL - commit comment"
303+
uses: peter-evans/commit-comment@v4
304+
continue-on-error: true
305+
with:
306+
body: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.event.pull_request.head.sha || github.sha }}

NEWS.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ https://github.com/networkupstools/nut/milestone/12
8181
* Abandoned use of obsolete `gethostbyname()` in favour of `getaddrinfo()`.
8282
Extended to be IPv6-capable along the way. [#1209]
8383

84+
- `nhs_ser` driver updates:
85+
* Driver source code includes a table to map baud rates (defined by the OS
86+
as C macros) to numbers and strings more useful to the driver program.
87+
It was discovered that not all operating systems define all the baud rates
88+
referenced by this table, so now several higher speeds would be compiled
89+
conditionally. [issue #3163]
90+
8491
- `nutdrv_qx` driver updates:
8592
* Define an internal `QX_FLAG_MAPPING_HANDLED` to check if the subdriver
8693
code (mapping table) and the data found from device walk sit together

docs/qa-guide.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,27 @@ packages.
535535
* https://build.opensuse.org/
536536
* https://openbuildservice.org/
537537
538+
It is anticipated that corresponding RPM and DEB recipes will evolve to
539+
match code base evolution as well as distribution-provided packages, so
540+
that these builds can be installed as temporary replacements of what the
541+
distro offers (if new features/fixes are required by the user), and that
542+
more and more platforms will get supported (not every one of them provides
543+
all prerequisites at all, or under the same spelling of package names).
544+
545+
It is also anticipated that beside NUT itself, further related components
546+
would be built in those OBS projects, e.g. the NUT-hosted fork of `libmodbus`
547+
with support of USB RTU until that gets merged into upstream, or clients
548+
like WMNut.
549+
550+
Resulting packages for several Linux platforms can be seen at:
551+
552+
* https://build.opensuse.org/project/show/home:networkupstools:nut-releases/nut
553+
for tagged releases
554+
* https://build.opensuse.org/package/show/home:networkupstools:nut-stable/nut
555+
for iterations of the `master` branch
556+
* Sibling OBS projects should automatically spawn and disappear nearby
557+
for pull requests
558+
538559
Continuous Integration (NUT CI farm) build agent preparation
539560
------------------------------------------------------------
540561
[[NUTCI_farm_agents]]

drivers/nhs_ser.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include <math.h>
4444

4545
#define DRIVER_NAME "NHS Nobreak Drivers"
46-
#define DRIVER_VERSION "0.03"
46+
#define DRIVER_VERSION "0.04"
4747
#define MANUFACTURER "NHS Sistemas Eletronicos LTDA"
4848

4949
#define DEFAULTBAUD 2400
@@ -96,10 +96,22 @@ static baud_rate_t baud_rates[] = {
9696
{ B921600, 921600, "921600 bps" },
9797
{ B1500000, 1500000, "1.5 Mbps" },
9898
{ B2000000, 2000000, "2 Mbps" },
99+
/* NOTE: Per https://github.com/networkupstools/nut/issues/3163
100+
* not all platforms offer all baud rates, so we wrap some into
101+
* conditional uses.
102+
*/
103+
#ifdef B2500000
99104
{ B2500000, 2500000, "2.5 Mbps" },
105+
#endif
106+
#ifdef B3000000
100107
{ B3000000, 3000000, "3 Mbps" },
108+
#endif
109+
#ifdef B3500000
101110
{ B3500000, 3500000, "3.5 Mbps" },
111+
#endif
112+
#ifdef B4000000
102113
{ B4000000, 4000000, "4 Mbps" },
114+
#endif
103115
};
104116
#define NUM_BAUD_RATES (sizeof(baud_rates) / sizeof(baud_rates[0]))
105117

0 commit comments

Comments
 (0)