-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 1.24 KB
/
archive.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
on:
release:
types: [published]
permissions:
contents: write
name: Build and upload xcstringslint release binary
jobs:
build-macos:
name: Build macOS Executable
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build artifact bundle
env:
ARTIFACT_FOLDER_NAME: "XCStringsLint.artifactbundle"
VERSION: ${{ github.ref_name }}
run: |
swift build -c release --arch x86_64 --arch arm64
BINARY_PATH=$(swift build -c release --arch x86_64 --arch arm64 --show-bin-path)
mkdir -p "$ARTIFACT_FOLDER_NAME/xcstringslint-$VERSION-macos/bin"
cp -f "$BINARY_PATH/xcstringslint" "$ARTIFACT_FOLDER_NAME/xcstringslint-$VERSION-macos/bin"
cp -r -- $BINARY_PATH/*.bundle "$ARTIFACT_FOLDER_NAME/xcstringslint-$VERSION-macos/bin"
sed "s/__VERSION__/$VERSION/g" .github/artifactbundle.json.template > "$ARTIFACT_FOLDER_NAME/info.json"
cp -f "LICENSE" "$ARTIFACT_FOLDER_NAME"
(zip -yr - "$ARTIFACT_FOLDER_NAME") > "./$ARTIFACT_FOLDER_NAME.zip"
- name: Upload binary to release
uses: softprops/action-gh-release@v2
with:
files: XCStringsLint.artifactbundle.zip