Skip to content

Commit 8960f6d

Browse files
committed
Merge branch 'main' into ben/text-wrapping-preference
2 parents 8e24809 + d68c90f commit 8960f6d

26 files changed

Lines changed: 299 additions & 181 deletions

File tree

.all-contributorsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,16 @@
481481
"contributions": [
482482
"code"
483483
]
484+
},
485+
{
486+
"login": "Code-DJ",
487+
"name": "Code-DJ",
488+
"avatar_url": "https://avatars.githubusercontent.com/u/8212554?v=4",
489+
"profile": "https://github.com/Code-DJ",
490+
"contributions": [
491+
"code",
492+
"bug"
493+
]
484494
}
485495
],
486496
"contributorsPerLine": 7,

.circleci/config.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI - Update Build Number
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
upadate-build-number:
6+
name: Update Build Number
7+
runs-on: [self-hosted, macOS]
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v2
11+
12+
- name: Bump Build Number
13+
run: |
14+
xcrun agvtool next-version -all
15+
16+
- name: Commit Changes
17+
run: |
18+
git add .
19+
git config --local user.email "action@github.com"
20+
git config --local user.name "GitHub Action"
21+
git commit -m "bump build number"
22+
- name: Push Changes
23+
uses: ad-m/github-push-action@v0.6.0
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
branch: temp/bump-build-number
27+
force: true
28+
- name: Create Pull Request
29+
uses: peter-evans/create-pull-request@v4
30+
with:
31+
branch: temp/bump-build-number
32+
delete-branch: true
33+
base: main
34+
title: Bump Build Number
35+
body: Automatically bump build number of all targets
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI - Pre Release
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
swiftlint:
6+
name: SwiftLint
7+
uses: ./.github/workflows/lint.yml
8+
secrets: inherit
9+
test:
10+
name: Testing CodeEdit
11+
needs: swiftlint
12+
uses: ./.github/workflows/tests.yml
13+
secrets: inherit
14+
deploy:
15+
if: github.repository_owner == 'CodeEditApp'
16+
name: Deploying CodeEdit [Prerelease]
17+
needs: [swiftlint, test]
18+
uses: ./.github/workflows/pre-release.yml
19+
secrets: inherit
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI - Pull Request
2+
on:
3+
pull_request:
4+
branches:
5+
- 'main'
6+
workflow_dispatch:
7+
jobs:
8+
swiftlint:
9+
name: SwiftLint
10+
uses: ./.github/workflows/lint.yml
11+
secrets: inherit
12+
test:
13+
name: Testing CodeEdit
14+
needs: swiftlint
15+
uses: ./.github/workflows/tests.yml
16+
secrets: inherit

.github/workflows/lint.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
name: SwiftLint
22

33
on:
4-
pull_request:
5-
paths:
6-
- '.github/workflows/swiftlint.yml'
7-
- '.swiftlint.yml'
8-
- '**/*.swift'
4+
workflow_dispatch:
5+
workflow_call:
96

107
jobs:
118
SwiftLint:
12-
runs-on: ubuntu-latest
9+
runs-on: [self-hosted, macOS] # ubuntu-latest
1310
steps:
1411
- uses: actions/checkout@v1
15-
- name: Remove TODOs
16-
run: exec ./.github/scripts/remove_todos.sh
1712
- name: GitHub Action for SwiftLint
18-
uses: norio-nomura/action-swiftlint@3.2.1
19-
- name: GitHub Action for SwiftLint with --strict
20-
uses: norio-nomura/action-swiftlint@3.2.1
21-
with:
22-
args: --strict
23-
- name: GitHub Action for SwiftLint (Only files changed in the PR)
24-
uses: norio-nomura/action-swiftlint@3.2.1
25-
env:
26-
DIFF_BASE: ${{ github.base_ref }}
27-
- name: GitHub Action for SwiftLint (Different working directory)
28-
uses: norio-nomura/action-swiftlint@3.2.1
29-
env:
30-
WORKING_DIRECTORY: Source
13+
run: swiftlint --strict
14+
15+
# Old version using `ubuntu-latest`
16+
# - name: Remove TODOs
17+
# run: exec ./.github/scripts/remove_todos.sh
18+
# - name: GitHub Action for SwiftLint
19+
# uses: norio-nomura/action-swiftlint@3.2.1
20+
# - name: GitHub Action for SwiftLint with --strict
21+
# uses: norio-nomura/action-swiftlint@3.2.1
22+
# with:
23+
# args: --strict
24+
# - name: GitHub Action for SwiftLint (Only files changed in the PR)
25+
# uses: norio-nomura/action-swiftlint@3.2.1
26+
# env:
27+
# DIFF_BASE: ${{ github.base_ref }}
28+
# - name: GitHub Action for SwiftLint (Different working directory)
29+
# uses: norio-nomura/action-swiftlint@3.2.1
30+
# env:
31+
# WORKING_DIRECTORY: Source

.github/workflows/pre-release.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ name: Build and Publish Pre-release
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- 'main'
5+
workflow_call:
86

97
jobs:
108
pre-release:
119
name: Build and Publish Pre-release
12-
runs-on: macos-12
10+
runs-on: [self-hosted, macOS]
1311
steps:
1412
- name: Checkout repository
1513
uses: actions/checkout@v2
14+
15+
############################
16+
# Install Certificate
17+
############################
1618
- name: Install codesign certificate
1719
env:
1820
# DEV_CERT_B64: Base64-encoded developer certificate as .p12
@@ -34,23 +36,35 @@ jobs:
3436
security create-keychain -p "$KEYCHAIN_PWD" "$KEYCHAIN_DB"
3537
security set-keychain-settings -lut "$KEYCHAIN_TIMEOUT" "$KEYCHAIN_DB"
3638
security unlock-keychain -p "$KEYCHAIN_PWD" "$KEYCHAIN_DB"
37-
echo -n "$DEV_CERT_B64" | base64 --decode --output "$DEV_CERT_P12"
39+
echo -n "$DEV_CERT_B64" | base64 --decode -o "$DEV_CERT_P12"
3840
security import "$DEV_CERT_P12" -P "$DEV_CERT_PWD" -A -t cert -f pkcs12 -k "$KEYCHAIN_DB"
39-
echo -n "$MAC_CERT_B64" | base64 --decode --output "$MAC_CERT_P12"
41+
echo -n "$MAC_CERT_B64" | base64 --decode -o "$MAC_CERT_P12"
4042
security import "$MAC_CERT_P12" -P "$MAC_CERT_PWD" -A -t cert -f pkcs12 -k "$KEYCHAIN_DB"
4143
security list-keychain -d user -s "$KEYCHAIN_DB"
44+
45+
############################
46+
# Build
47+
############################
4248
- name: Build CodeEdit
4349
env:
4450
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
4551
run: xcodebuild -scheme CodeEdit -configuration Release -derivedDataPath "$RUNNER_TEMP/DerivedData" -archivePath "$RUNNER_TEMP/CodeEdit.xcarchive" -skipPackagePluginValidation DEVELOPMENT_TEAM=$APPLE_TEAM_ID archive
52+
53+
############################
54+
# Sign
55+
############################
4656
- name: Sign CodeEdit
4757
env:
4858
CODESIGN_SIGN: ${{ secrets.CODESIGN_SIGN }}
4959
run: |
5060
REV=$(git rev-parse --short HEAD)
5161
echo "REV=$REV" >> $GITHUB_ENV
5262
codesign --sign "$CODESIGN_SIGN" -vvv --verbose --strict --options=runtime --prefix austincondiff.CodeEdit. --force --deep --timestamp "$RUNNER_TEMP/CodeEdit.xcarchive/Products/Applications/CodeEdit.app"
53-
- name: Using brew
63+
64+
############################
65+
# DMG & Notarize
66+
############################
67+
- name: Create DMG & Notarize
5468
env:
5569
CODESIGN_SIGN: ${{ secrets.CODESIGN_SIGN }}
5670
APPLE_ID: ${{ secrets.APPLE_ID }}
@@ -60,7 +74,6 @@ jobs:
6074
REV=$(git rev-parse --short HEAD)
6175
echo "REV=$REV" >> $GITHUB_ENV
6276
xcrun notarytool store-credentials CodeEdit --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_ID_PWD"
63-
brew install create-dmg
6477
create-dmg \
6578
--volname "CodeEdit" \
6679
--window-pos 200 120 \
@@ -73,6 +86,10 @@ jobs:
7386
--notarize "CodeEdit" \
7487
"$RUNNER_TEMP/CodeEdit-$REV.dmg" \
7588
"$RUNNER_TEMP/CodeEdit.xcarchive/Products/Applications/"
89+
90+
############################
91+
# Sparkle Appcast
92+
############################
7693
- name: Update Sparkle appcast
7794
env:
7895
# SPARKLE_KEY: Sparkle EdDSA key exported from `generate_keys -x` as plain text
@@ -81,7 +98,7 @@ jobs:
8198
# SPARKLE_LINK: CodeEdit Website
8299
SPARKLE_KEY: ${{ secrets.SPARKLE_KEY }}
83100
SPARKLE_CHANNEL: dev
84-
SPARKLE_DL_PREFIX: "https://github.com/CodeEditApp/CodeEdit/releases/download/latest"
101+
SPARKLE_DL_PREFIX: "https://github.com/CodeEditApp/CodeEdit/releases/download/latest/"
85102
SPARKLE_LINK: "https://github.com/CodeEditApp/CodeEdit"
86103
run: |
87104
SPARKLE_BIN="$RUNNER_TEMP/DerivedData/SourcePackages/artifacts/sparkle/bin"
@@ -91,8 +108,10 @@ jobs:
91108
cp "$RUNNER_TEMP/CodeEdit-$REV.dmg" "$SPARKLE_ARCHIVE"
92109
SPARKLE_SIG=$("$SPARKLE_BIN/sign_update" --ed-key-file "$RUNNER_TEMP/sparkle_key" "$SPARKLE_ARCHIVE/CodeEdit-$REV.dmg" | cut -d\" -f2)
93110
"$SPARKLE_BIN/generate_appcast" --ed-key-file "$RUNNER_TEMP/sparkle_key" --download-url-prefix "$SPARKLE_DL_PREFIX" --link "$SPARKLE_LINK" --channel "$SPARKLE_CHANNEL" --maximum-deltas 0 "$SPARKLE_ARCHIVE"
94-
brew install xmlstarlet
95-
xmlstarlet ed -O --inplace --insert "/rss/channel/item/enclosure" --type attr -n "sparkle:edSignature" -v "$SPARKLE_SIG" "$SPARKLE_ARCHIVE/appcast.xml"
111+
112+
############################
113+
# Publish Pre Release
114+
############################
96115
- name: Publish Pre-release
97116
uses: marvinpinto/action-automatic-releases@latest
98117
with:
@@ -103,6 +122,10 @@ jobs:
103122
automatic_release_tag: "latest"
104123
prerelease: true
105124
repo_token: "${{ secrets.GITHUB_TOKEN }}"
125+
126+
############################
127+
# Cleanup Secrets
128+
############################
106129
- name: Clean up keychain and provisioning profile
107130
if: ${{ always() }}
108131
run: |

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ name: Release Drafter
33
on:
44
# Allow running it manually in case we forget to label a PR before merging
55
workflow_dispatch:
6-
push:
7-
branches:
8-
- main
6+
workflow_call:
97

108
jobs:
119
update_release_draft:

.github/workflows/tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
name: Tests
22
on:
33
workflow_dispatch:
4-
push:
5-
branches:
6-
- 'main'
7-
pull_request:
8-
branches:
9-
- 'main'
4+
workflow_call:
105
jobs:
116
test:
127
name: Testing CodeEdit
13-
runs-on: macos-12 #[self-hosted, macOS]
8+
runs-on: [self-hosted, macOS]
149
steps:
1510
- name: Checkout repository
1611
uses: actions/checkout@v1
1712
- name: Testing App
18-
run: exec ./.github/scripts/test_app.sh
13+
run: exec ./.github/scripts/test_app.sh arm

0 commit comments

Comments
 (0)