[skip-ci] Reviewed-on: #54 Co-authored-by: Renovate[BOT] <renovate-bot@auengun.net> Co-committed-by: Renovate[BOT] <renovate-bot@auengun.net>
112 lines
3.7 KiB
YAML
112 lines
3.7 KiB
YAML
# Custom build of Uber's SSH Certificate PAM module
|
|
# Source available at git.auengun.net/GregoryDosh/pam_ussh
|
|
# Copyright (C) 2024 GregoryDosh
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
# License, or (at your option) any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# SPDX-FileCopyrightText: 2024 GregoryDosh
|
|
---
|
|
name: Build Module
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-module:
|
|
name: Build Module
|
|
runs-on: ubuntu-act-latest
|
|
if: secrets.REPO_PUBLISH_TOKEN != ''
|
|
steps:
|
|
- name: Clone Repo into Workspace
|
|
uses: https://git.auengun.net/homelab/action-common-setup@3e92f643023a84a6b2bdc495a271846c5e98c949 # 1.5.0
|
|
|
|
- name: Create Release Title
|
|
run: |
|
|
{
|
|
printf "RELEASE_TITLE="
|
|
cat go.mod | grep golang.org/x/crypto | cut -f 2 -d" " | tr -d '\n'
|
|
echo -n "-${{ env.GITHUB_RUN_NUMBER }}-${{ github.sha }}" | cut -c1-9
|
|
} >> "$GITHUB_ENV"
|
|
|
|
- name: Vet License & Vulnerabilities
|
|
id: make_vet
|
|
shell: bash
|
|
run: |
|
|
set +e
|
|
make install_deps 2>&1 | tee vet.log
|
|
make vet 2>&1 | tee vet.log
|
|
RESULT="$?"
|
|
set -e
|
|
{
|
|
echo ""
|
|
echo "<details open>"
|
|
echo ""
|
|
echo "<summary>## License & Vulnerability Scan</summary>"
|
|
echo ""
|
|
echo "\`\`\`shell"
|
|
cat vet.log
|
|
echo "\`\`\`"
|
|
echo ""
|
|
echo "</details>"
|
|
} 2>&1 >> "${{ github.workspace }}/.pr-comment.md"
|
|
echo "Saved to '${{ github.workspace }}/.pr-comment.md'"
|
|
exit $RESULT
|
|
|
|
- name: Build Module
|
|
id: make_build
|
|
shell: bash
|
|
run: |
|
|
set +e
|
|
apt-get update && apt-get install -y gcc-aarch64-linux-gnu
|
|
make build 2>&1 | tee build.log
|
|
RESULT="$?"
|
|
set -e
|
|
{
|
|
echo "# pam_ussh ${{ env.RELEASE_TITLE }}"
|
|
echo ""
|
|
echo "<details open>"
|
|
echo ""
|
|
echo "<summary>## Build Log</summary>"
|
|
echo ""
|
|
echo "\`\`\`shell"
|
|
cat build.log
|
|
echo "\`\`\`"
|
|
echo ""
|
|
echo "</details>"
|
|
} 2>&1 >> "${{ github.workspace }}/.pr-comment.md"
|
|
echo "Saved to '${{ github.workspace }}/.pr-comment.md'"
|
|
exit $RESULT
|
|
|
|
- name: Post/Update PR Comment
|
|
if: ${{ github.event_name == 'pull_request' && !cancelled() }}
|
|
continue-on-error: true
|
|
uses: https://git.auengun.net/homelab/action-pr-comment@e50718ea836d26d3d2133278b97706ea1ccf48a0 # 1.3.0
|
|
|
|
- name: Create Release
|
|
if: ${{ success() && github.ref == 'refs/heads/main' }}
|
|
uses: https://git.auengun.net/actions/forgejo-release@fc0488c944626f9265d87fbc4dd6c08f78014c63 # v2.7.3
|
|
with:
|
|
direction: upload
|
|
url: https://git.auengun.net
|
|
release-dir: release
|
|
tag: "${{ env.RELEASE_TITLE }}"
|
|
title: "${{ env.RELEASE_TITLE }}"
|
|
token: "${{ secrets.REPO_PUBLISH_TOKEN }}"
|
|
release-notes: "${{ github.event.head_commit.message }}"
|
|
hide-archive-link: true
|
|
override: true
|