Building Swift packages on Windows using GitHub Actions - part 11 #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
jobs: | ||
build-mac-executable: | ||
name: Create Release | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build executable for release | ||
run: swift build -c release --arch arm64 --arch x86_64 --product chatgpt | ||
- name: Compress archive | ||
run: tar -czf ${{ github.ref_name }}.tar.gz -C .build/apple/Products/Release chatgpt | ||
- name: Create release and upload executable to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ github.ref_name }}.tar.gz | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
build-windows-executable: | ||
name: Build Windows Executable | ||
runs-on: windows-latest | ||
steps: | ||
- uses: compnerd/gha-setup-swift@main | ||
with: | ||
branch: swift-5.7.1-release | ||
tag: 5.7.1-RELEASE | ||
- uses: actions/checkout@v4 | ||
- run: git config --global core.protectNTFS false | ||
- run: swift build -c release --product chatgpt | ||
- run: cp .build\release\chatgpt.exe chatgpt.exe | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: chatgpt-windows.exe | ||
path: chatgpt.exe |