Skip to content

Commit 73af9db

Browse files
Christoph DieckChristoph Dieck
authored andcommitted
initial commit
1 parent 2fbd115 commit 73af9db

65 files changed

Lines changed: 6697 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [ main, master ]
9+
10+
jobs:
11+
build-and-test:
12+
name: Build and Test
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Cache Swift packages
19+
uses: actions/cache@v4
20+
with:
21+
path: |
22+
.build
23+
.build/checkouts
24+
.build/reports
25+
.swiftpm
26+
key: ${{ runner.os }}-swift-${{ hashFiles('Package.resolved') }}
27+
restore-keys: |
28+
${{ runner.os }}-swift-
29+
30+
- name: Show Swift version
31+
run: swift --version
32+
33+
- name: Build
34+
run: swift build
35+
36+
- name: Test
37+
run: swift test --verbose
38+
39+
release:
40+
name: Release on Tag
41+
runs-on: macos-latest
42+
if: startsWith(github.ref, 'refs/tags/')
43+
needs: build-and-test
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Show Swift version
49+
run: swift --version
50+
51+
- name: Build release
52+
run: swift build -c release
53+
54+
- name: Build .app bundle
55+
run: make app
56+
57+
- name: Build DMG
58+
run: make dmg
59+
60+
- name: Upload DMG as artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: screenpranklocker-dmg
64+
path: build/*.dmg
65+
66+
- name: Find DMG
67+
id: find_dmg
68+
run: |
69+
set -e
70+
dmg=$(ls build/*.dmg | head -n1)
71+
echo "dmg=$dmg" >> $GITHUB_OUTPUT
72+
73+
- name: Create GitHub Release
74+
id: create_release
75+
uses: actions/create-release@v1
76+
with:
77+
tag_name: ${{ github.ref_name }}
78+
release_name: Release ${{ github.ref_name }}
79+
body: "Automated release built by CI"
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
83+
- name: Upload DMG to Release
84+
uses: actions/upload-release-asset@v1
85+
with:
86+
upload_url: ${{ steps.create_release.outputs.upload_url }}
87+
asset_path: ${{ steps.find_dmg.outputs.dmg }}
88+
asset_name: ${{ steps.find_dmg.outputs.dmg }}
89+
asset_content_type: application/x-apple-diskimage

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ fastlane/report.xml
6060
fastlane/Preview.html
6161
fastlane/screenshots/**/*.png
6262
fastlane/test_output
63+
.vscode
64+
.DS_Store
65+
build

AppIcon.icns

237 KB
Binary file not shown.

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
APP_NAME := ScreenPrankLocker
2+
VERSION := 1.0.0
3+
4+
.PHONY: all build app pkg dmg install test run clean help
5+
6+
all: pkg
7+
8+
build:
9+
./build.sh build
10+
11+
app:
12+
./build.sh app
13+
14+
pkg:
15+
./build.sh pkg
16+
17+
dmg:
18+
./build.sh dmg
19+
20+
install:
21+
./build.sh install
22+
23+
test:
24+
./build.sh test
25+
26+
run:
27+
./build.sh run
28+
29+
clean:
30+
./build.sh clean
31+
32+
help:
33+
./build.sh help
34+

Package.resolved

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// swift-tools-version: 5.9
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "ScreenPrankLocker",
7+
platforms: [
8+
.macOS(.v13)
9+
],
10+
dependencies: [
11+
.package(url: "https://github.com/typelift/SwiftCheck", from: "0.12.0")
12+
],
13+
targets: [
14+
.executableTarget(
15+
name: "ScreenPrankLocker",
16+
path: "Sources/ScreenPrankLocker",
17+
exclude: [
18+
"Resources/icon.png"
19+
],
20+
resources: [
21+
.copy("Resources/farts"),
22+
.copy("Resources/icon-small.png")
23+
],
24+
linkerSettings: [
25+
.linkedFramework("AVFoundation"),
26+
.linkedFramework("CoreMedia"),
27+
.linkedFramework("CoreVideo"),
28+
]
29+
),
30+
.testTarget(
31+
name: "ScreenPrankLockerTests",
32+
dependencies: [
33+
"ScreenPrankLocker",
34+
"SwiftCheck"
35+
],
36+
path: "Tests/ScreenPrankLockerTests"
37+
)
38+
]
39+
)

0 commit comments

Comments
 (0)