Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/00-preclean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "GHA-00: Pre-clean"

on:
push:
branches: [ "master", "FTY", "fightwarn", "FTY-obs" ]
tags:
- v*
pull_request_target:
# The branches below must be a subset of the branches above
# Note that for PRs this runs the copy of workflow in the
# target branch (and only then gets some of the permissions
# listed below), and identification/naming of PR source vs.
# a pushed branch (e.g. master updated by a PR merge) is
# tricky.
branches: [ "master", "FTY", "fightwarn", "FTY-obs" ]
workflow_dispatch:
# Allow manually running the action, e.g. if disabled after some quietness in the source

permissions:
checks: write
contents: write
issues: write
pull-requests: write

jobs:
clean:
runs-on: ubuntu-latest
steps:
- name: pr-deleter
if: github.event.pull_request.number > 0
uses: maheshrayas/action-pr-comment-delete@v3.0
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
org: networkupstools # '${{context.repo.owner}}'
repo: nut # '${{context.repo.repo}}'
user: 'AppVeyorBot'
# user: 'github-actions[bot]' #commented by the userid
issue: '${{github.event.number}}'
31 changes: 31 additions & 0 deletions .github/workflows/01-make-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ jobs:
echo "github.ref='${{ github.ref }}'" || true
echo "github.ref_name='${{ github.ref_name }}'" || true

- name: "GHA-01: Create/Update new GH PR comment for future link"
if: github.event.pull_request.number > 0
continue-on-error: true
env:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Preparing a ZIP file with standard source tarball and another
tarball with pre-built docs for commit ${{ env.ref }} ...
comment-tag: tarball-url
github-token: ${{ env.GITHUB_TOKEN }}

# Make build identification more useful (so we use no fallbacks in script)
- name: Try to get more Git metadata
run: |
Expand Down Expand Up @@ -267,6 +281,23 @@ jobs:
compression-level: 0
overwrite: true

- name: "GHA-01: Create/update new GH PR comment with link"
if: github.event.pull_request.number > 0
continue-on-error: true
env:
artifact_name: "NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip"
artifact_url: ${{ steps.upload_artifact.outputs.artifact-url }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: thollander/actions-comment-pull-request@v3
with:
message: |
A ZIP file with standard source tarball and another tarball
with pre-built docs for commit ${{ env.ref }} is temporarily
available: [${{ env.artifact_name }}](${{ env.artifact_url }}).
comment-tag: tarball-url
github-token: ${{ env.GITHUB_TOKEN }}

# NOTE: Despite the docs examples, due to GH API changes in Mar 2025
# this action can no longer update an existing check, only create a
# new one. Also calls authenticated with "github-actions" GH App may
Expand Down
25 changes: 25 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ environment:
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=6
CCACHE_DIR: /home/appveyor/.ccache

# Customize GH notification message template
# TODO: for repetitive commits in a PR consider a clean-up GHA like
# https://github.com/marketplace/actions/delete-pr-comments-during-subsequent-ci
notifications:
- provider: GitHubPullRequest
template: |
{{#passed}}:white_check_mark:{{/passed}}{{#failed}}:x:{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}})
* [artifacts{{#failed}} (if any){{/failed}}]({{buildurl}}/artifacts)
{{#passed}}
{{#jobs}}
{{#messages}}
* {{message}}
{{/messages}}
{{/jobs}}
{{/passed}}

# https://github.com/networkupstools/nut/blob/Windows-v2.8.0-1/docs/config-prereqs.txt#L951
# or look for the chapter in nearby lines in later (current) revisions.
# Note: not using `time` in scripts currently - they did upset
Expand Down Expand Up @@ -152,6 +168,15 @@ after_test:
C:\msys64\usr\bin\bash -lc 'date -u'
cd .inst
7z a ../NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%.7z NUT*

# Consider APPVEYOR_PULL_REQUEST_HEAD_COMMIT (PR) vs APPVEYOR_REPO_COMMIT (target branch, or ephemeral)
- ps: |
$nut7z = "NUT-for-Windows-x86_64-SNAPSHOT-$($env:APPVEYOR_BUILD_VERSION).7z"
$msg = "A 7-zip archive with built NUT for Windows debug binaries is temporarily available: [$($nut7z)]($($env:APPVEYOR_URL)/api/buildjobs/$($env:APPVEYOR_JOB_ID)/artifacts/$($nut7z))"
echo $msg
echo "build-id:$($env:APPVEYOR_BUILD_ID) job-id:$($env:APPVEYOR_JOB_ID) prj-id:$($env:APPVEYOR_PROJECT_ID)"
Add-AppveyorMessage $msg

- cmd: |
REM Preserve the current working directory:
set CHERE_INVOKING=yes
Expand Down
Loading