-
Notifications
You must be signed in to change notification settings - Fork 14
92 lines (89 loc) · 2.94 KB
/
pkg_arch-aur.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 'PKG: Archlinux AUR Release'
on:
workflow_dispatch:
inputs:
version:
description: "Version to release"
required: true
default: "8.0.0"
type: string
skip:
description: "Skip release"
required: false
default: false
type: boolean
release:
types: [published]
jobs:
setup:
runs-on: ubuntu-latest
name: 'Unify Inputs'
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set Version (Workflow Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV
- name: Set Version (Release Event)
if: github.event_name == 'release'
run: |
echo VERSION=${{ github.event.release.tag_name }} >> $GITHUB_ENV
- name: Unified Version
id: version
run: |
INPUT_NAME=${{ inputs.name }}
if [[ ${INPUT_NAME} == '' ]]; then
echo "Name is empty, using default"
echo "name=mondoo" >> $GITHUB_OUTPUT
else
echo "Name: ${INPUT_NAME}"
echo "name=${INPUT_NAME}" >> $GITHUB_OUTPUT
fi
V=$(echo $VERSION | sed 's/v//')
echo "Version: $V"
echo "version=${V}" >> $GITHUB_OUTPUT
update-pkgs:
runs-on: ubuntu-latest
name: 'Generate & Locally Commit PKGBUILDs'
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '>=1.17.0'
- name: Execute generator (make update)
run: |
cd packages/archlinux
make update
- name: 'DEBUG: Show generated package versions'
run: |
cd packages/archlinux
echo "cnquery: $(cat cnquery/PKGBUILD | grep orignalVersion=)"
echo "cnspec: $(cat cnspec/PKGBUILD | grep orignalVersion=)"
- name: Publish cnquery AUR package
if: ${{ !inputs.skip }}
uses: KSXGitHub/[email protected]
with:
pkgname: cnquery
pkgbuild: packages/archlinux/cnquery/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: ${{ needs.setup.outputs.version }}
force_push: 'true'
- name: Publish cnspec AUR package
if: ${{ !inputs.skip }}
uses: KSXGitHub/[email protected]
with:
pkgname: cnspec
pkgbuild: packages/archlinux/cnspec/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: ${{ needs.setup.outputs.version }}
force_push: 'true'