Skip to content

init

init #23

Workflow file for this run

# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# vars
APP_NAME: ${{ vars.APP_NAME }}
INFO_PLIST_PATH: ${{ vars.INFO_PLIST_PATH }}
PROJECT_PATH: ${{ vars.PROJECT_PATH }}
XCODE_BUILD_DIR: ${{ vars.XCODE_BUILD_DIR }}
XCODE_BUILD_PATH: ${{ vars.XCODE_BUILD_PATH }}
# secrets
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALI_AK: ${{ secrets.ALI_AK }}
ALI_SK: ${{ secrets.ALI_SK }}
BAIDU_AK: ${{ secrets.BAIDU_AK }}
BAIDU_SK: ${{ secrets.BAIDU_SK }}
BIGHUGETHESAURUS_SK: ${{ secrets.BIGHUGETHESAURUS_SK }}
NIUTRANS_SK: ${{ secrets.NIUTRANS_SK }}
VOLCENGINE_AK: ${{ secrets.VOLCENGINE_AK }}
VOLCENGINE_SK: ${{ secrets.VOLCENGINE_SK }}
# secrets
SPARKLE_ED_PRIVATE_KEY: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }}
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
jobs:
build:
runs-on: macos-14
if: ${{ !contains(github.event.head_commit.message, 'chore') }}
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.2
- name: Update version
id: update_version
run: echo "VERSION=$(scripts/update_version.sh)" >> $GITHUB_OUTPUT
- name: Code Sign
id: code_sign
run: scripts/code_sign.sh
- name: Release
id: release
run: VERSION=${{steps.update_version.outputs.VERSION}} scripts/release.sh
- name: Upload
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: DerivedData/Build/Products/Release/*.dmg
tag: v${{ steps.update_version.outputs.VERSION }}
overwrite: true
file_glob: true