Skip to content

Commit 0ffefdf

Browse files
committed
Releaseyam2
1 parent fcf1caf commit 0ffefdf

1 file changed

Lines changed: 15 additions & 58 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -18,64 +18,27 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
# 2. Set up temporary keychain and import certificate
22-
- name: Set up keychain and import certificate
23-
env:
24-
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
25-
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
26-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
27-
KEYCHAIN_NAME: build.keychain # Temporary keychain name
28-
# Use the specific identity from the logs/certificate
29-
SIGNING_IDENTITY: "Apple Development: sacha.sayan@gmail.com (2RH7R3YX2H)"
30-
run: |
31-
# Exit immediately if a command exits with a non-zero status.
32-
# Treat unset variables as an error when substituting.
33-
# Prevent errors in a pipeline from being masked.
34-
set -eo pipefail
35-
36-
# Create temporary keychain
37-
echo "Creating keychain: $KEYCHAIN_NAME"
38-
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
39-
# Make the temporary keychain the default
40-
echo "Setting default keychain..."
41-
security default-keychain -s "$KEYCHAIN_NAME"
42-
# Unlock the temporary keychain
43-
echo "Unlocking keychain..."
44-
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
45-
# Set keychain timeout to prevent locking during build
46-
echo "Setting keychain timeout..."
47-
security set-keychain-settings -lut 21600 "$KEYCHAIN_NAME"
48-
49-
# Decode the base64 certificate
50-
echo "Decoding certificate..."
51-
echo "$BUILD_CERTIFICATE_BASE64" | base64 --decode > certificate.p12
52-
53-
# Import the certificate into the keychain, allowing codesign access
54-
echo "Importing certificate..."
55-
security import certificate.p12 -k "$KEYCHAIN_NAME" -P "$P12_PASSWORD" -T /usr/bin/codesign
56-
57-
# Explicitly allow codesign to access the imported private key without prompts
58-
echo "Setting key partition list for identity: $SIGNING_IDENTITY"
59-
# Corrected command: Use -l (label) instead of -D, remove -s (find)
60-
security set-key-partition-list -S apple-tool:,apple:,codesign: -k "$KEYCHAIN_PASSWORD" -t private "$KEYCHAIN_NAME" -l "$SIGNING_IDENTITY"
61-
62-
# Set this identity as the preferred one for codesigning
63-
echo "Setting identity preference..."
64-
security set-identity-preference -n -s "$SIGNING_IDENTITY" "$KEYCHAIN_NAME"
65-
66-
# Clean up the certificate file
67-
rm -f certificate.p12
68-
69-
echo "Keychain setup complete."
21+
# 2. Import code signing certificate using Apple Actions
22+
- name: Import Code Signing Certificates
23+
uses: apple-actions/import-codesign-certs@v3
24+
with:
25+
p12-file-base64: ${{ secrets.APPSTORE_CERTIFICATES_FILE_BASE64 }}
26+
p12-password: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }}
7027

7128
# 3. Install create-dmg dependency (required by 'make package')
7229
- name: Install create-dmg
7330
run: brew install create-dmg
7431

7532
# 4. Build the Release configuration, package, and sign the DMG
76-
# Makefile will now use the certificate imported into the temporary keychain
33+
# Override Xcode settings to force manual signing.
34+
# The identity should be picked up from the keychain set up by the previous step.
7735
- name: Build and Package Release DMG
78-
run: make package CONFIG=Release
36+
run: |
37+
echo "Building and packaging with manual signing overrides..."
38+
make package CONFIG=Release \
39+
CODE_SIGN_STYLE=Manual \
40+
DEVELOPMENT_TEAM="" \
41+
PROVISIONING_PROFILE_SPECIFIER=""
7942
8043
# 5. Create a Draft GitHub Release and upload the DMG
8144
- name: Create GitHub Release
@@ -96,10 +59,4 @@ jobs:
9659
# The GITHUB_TOKEN is automatically provided by GitHub Actions
9760
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9861

99-
# 6. Cleanup: Delete temporary keychain (optional, runs even if previous steps fail)
100-
- name: Cleanup Keychain
101-
if: always() # Ensure cleanup runs even if the build fails
102-
run: |
103-
KEYCHAIN_NAME=build.keychain
104-
echo "Cleaning up keychain: $KEYCHAIN_NAME"
105-
security delete-keychain "$KEYCHAIN_NAME" || echo "Keychain cleanup failed or keychain did not exist."
62+
# 6. Cleanup step removed as apple-actions/import-codesign-certs handles its keychain.

0 commit comments

Comments
 (0)