1- name : Staging / Nightly Build
1+ name : Staging / Development Build
22
33on :
44 push :
@@ -9,115 +9,59 @@ permissions:
99 contents : write
1010
1111concurrency :
12- group : nightly -${{ github.ref }}
13- cancel-in-progress : true # Supersede previous nightly on rapid pushes
12+ group : staging -${{ github.ref }}
13+ cancel-in-progress : true # Supersede previous run on rapid pushes
1414
1515jobs :
16+ test :
17+ name : Run Tests
18+ uses : ./.github/workflows/test.yml
19+
1620 prepare :
1721 name : Prepare Metadata
1822 runs-on : ubuntu-latest
1923 timeout-minutes : 5
24+ needs : test
2025 outputs :
21- version : ${{ steps.meta.outputs.version }}
22- base_version : ${{ steps.meta.outputs.base_version }}
23- git_hash : ${{ steps.meta.outputs.git_hash }}
24- build_date : ${{ steps.meta.outputs.build_date }}
26+ version : ${{ steps.version.outputs.version }}
27+ tag : ${{ steps.version.outputs.tag }}
2528
2629 steps :
2730 - name : Checkout repository
28- uses : actions/checkout@v6
31+ uses : actions/checkout@v4
2932
3033 - name : Determine Version
3134 id : version
3235 uses : ./.github/actions/determine-version
3336
34- - name : Resolve build metadata
35- id : meta
36- run : |
37- set -euo pipefail
38- HASH=$(git rev-parse --short HEAD)
39- DATE=$(date +%Y-%m-%d)
40- BASE_VERSION="${{ steps.version.outputs.version }}"
41-
42- VERSION="${BASE_VERSION}+${HASH}"
43- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
44- echo "base_version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
45- echo "git_hash=$HASH" >> "$GITHUB_OUTPUT"
46- echo "build_date=$DATE" >> "$GITHUB_OUTPUT"
47- echo "::notice::Nightly version: $VERSION"
48-
49- build :
50- needs : prepare
51- uses : ./.github/workflows/build-and-package.yml
52- with :
53- version : ${{ needs.prepare.outputs.version }}
54- is_nightly : true
55- asset_name_prefix : OpenSSH-GUI-nightly
56-
57- deploy-aur-nightly :
58- name : Update AUR Nightly Package
37+ deploy-aur-git :
38+ name : Update AUR Git Package
5939 runs-on : ubuntu-latest
6040 timeout-minutes : 15
61- needs : [ prepare, build ]
41+ needs : [ test, prepare ]
6242
6343 steps :
6444 - name : Checkout repository
65- uses : actions/checkout@v6
45+ uses : actions/checkout@v4
6646 with :
6747 fetch-depth : 1
6848
69- - name : Download build artifacts
70- uses : actions/download-artifact@v8
71- with :
72- path : artifacts/
73-
74- - name : Prepare and update nightly PKGBUILD
49+ - name : Update openssh-gui-git PKGBUILD
7550 run : |
7651 set -euo pipefail
77- rm -rf aur-assets
78- mkdir -p aur-assets
79-
80- find artifacts -type f | while read -r FILE; do
81- DEST="aur-assets/$(basename "$FILE")"
82- if [[ -f "$DEST" ]]; then
83- echo "::error::AUR artifact name collision: $(basename "$FILE")"
84- exit 1
85- fi
86- cp "$FILE" "$DEST"
87- done
88-
89- test -f aur-assets/OpenSSH-GUI-nightly-linux-x64 \
90- || { echo "::error::Missing nightly linux binary"; exit 1; }
91- test -f aur-assets/appicon.png \
92- || { echo "::error::Missing appicon.png"; exit 1; }
93- test -f "aur-assets/io.github.frequency403.openssh_gui.desktop" \
94- || { echo "::error::Missing .desktop file"; exit 1; }
95- test -f LICENSE \
96- || { echo "::error::Missing LICENSE"; exit 1; }
97-
98- DATE=$(date +%Y%m%d)
99- AUR_VERSION="${{ needs.prepare.outputs.base_version }}.${DATE}.${{ needs.prepare.outputs.git_hash }}"
100- echo "AUR_VERSION=$AUR_VERSION" >> "$GITHUB_ENV"
101-
102- SHA_BIN=$(sha256sum aur-assets/OpenSSH-GUI-nightly-linux-x64 | cut -d' ' -f1)
103- SHA_ICON=$(sha256sum aur-assets/appicon.png | cut -d' ' -f1)
104- SHA_DESKTOP=$(sha256sum "aur-assets/io.github.frequency403.openssh_gui.desktop" | cut -d' ' -f1)
105- SHA_LICENSE=$(sha256sum LICENSE | cut -d' ' -f1)
106-
107- sed -i "s/^pkgver=.*/pkgver=$AUR_VERSION/" openssh-gui-nightly/PKGBUILD
108- sed -i "s/^pkgrel=.*/pkgrel=1/" openssh-gui-nightly/PKGBUILD
109- sed -i "s/^sha256sums=.*/sha256sums=('$SHA_BIN' '$SHA_ICON' '$SHA_DESKTOP' '$SHA_LICENSE')/" \
110- openssh-gui-nightly/PKGBUILD
52+ VERSION="${{ needs.prepare.outputs.version }}"
53+ sed -i "s/^pkgver=.*/pkgver=$VERSION/" openssh-gui-git/PKGBUILD
54+ sed -i "s/^pkgrel=.*/pkgrel=1/" openssh-gui-git/PKGBUILD
11155
11256 echo "Updated PKGBUILD:"
113- grep -E '^(pkgver=|pkgrel=|sha256sums= )' openssh-gui-nightly /PKGBUILD
57+ grep -E '^(pkgver=|pkgrel=)' openssh-gui-git /PKGBUILD
11458
115- - name : Publish AUR (openssh-gui-nightly )
59+ - name : Publish AUR (openssh-gui-git )
11660 uses : KSXGitHub/github-actions-deploy-aur@v4.1.1
11761 with :
118- pkgname : openssh-gui-nightly
119- pkgbuild : ./openssh-gui-nightly /PKGBUILD
62+ pkgname : openssh-gui-git
63+ pkgbuild : ./openssh-gui-git /PKGBUILD
12064 commit_username : ${{ github.repository_owner }}
12165 commit_email : ${{ github.repository_owner }}@users.noreply.github.com
12266 ssh_private_key : ${{ secrets.AUR_SSH_PRIVATE_KEY }}
123- commit_message : " Nightly update ${{ env.AUR_VERSION }}"
67+ commit_message : " Development update ${{ needs.prepare.outputs.tag }}"
0 commit comments