-
Notifications
You must be signed in to change notification settings - Fork 23
116 lines (98 loc) · 3.99 KB
/
flatpak-bundle.yml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
###############################################################################
# _ _ _ _ _____ _
# | | | | | | | | | __ \(_)
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
# | | | |
# |_| |_|
#
# Copyright (c) 2024 Claudio André <[email protected]>
#
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, as expressed in version 2, seen at
# http://www.gnu.org/licenses/gpl-2.0.html
###############################################################################
# GitHub Action to build John the Ripper's flatpak bundle
# More info at https://github.com/openwall/john-packages
---
name: Flatpak Bundle
on:
workflow_dispatch:
push:
branches:
- "flatpak"
env:
DISPLAY: ":0.0"
permissions:
contents: read
jobs:
build:
name: Build bundle
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
ciscobinary.openh264.org:80
dl.flathub.org:443
esm.ubuntu.com:443
flathub.org:443
github.com:443
motd.ubuntu.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
raw.githubusercontent.com:443
www.tcpdump.org:443
- name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get data
id: data
run: |
{
echo "now=$(date -u)"
echo "revision=$(git rev-parse --short=7 HEAD 2>/dev/null)"
echo "version=1.9.$(date +%Y%m%d)"
} >> "$GITHUB_OUTPUT"
- name: Dependencies
run: |
sudo apt-get update -yq
sudo apt-get install -y flatpak dbus-x11
- name: Build
run: |
wget https://github.com/openwall/john-packages/archive/refs/heads/release.zip -O main.zip #TODO undo Me
unzip main.zip
cp -r scripts/ john-packages-release/deploy/ #TODO undo Me
# To build the package, go to the place the recipe lives
cd john-packages-release/deploy/flatpak
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --user flathub org.flatpak.Builder
dbus-launch flatpak run org.flatpak.Builder --force-clean --user --install --install-deps-from=flathub \
--ccache --mirror-screenshots-url=https://dl.flathub.org/media/ --repo=repo builddir com.openwall.John.json
flatpak build-bundle repo john.flatpak com.openwall.John
flatpak run com.openwall.John
cp john.flatpak "$GITHUB_WORKSPACE"
sha256sum john.flatpak
shell: bash
- name: "Upload Artifact"
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: bundle
path: john.flatpak
retention-days: 15
- name: Test
run: |
# Required defines
export FLATPAK='true'
export JTR_BIN='john'
export TEST=';full;extra;OpenCL-info;' # Controls how the test will happen
wget https://raw.githubusercontent.com/openwall/john-packages/main/scripts/run_tests.sh
source run_tests.sh
shell: bash