Safer file creation #32
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- '**' | |
concurrency: production | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: Install swift | |
uses: SwiftyLab/setup-swift@latest | |
with: | |
swift-version: "5.9" | |
- name: Run Linux Build | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
swift build -c release --arch arm64 --arch x86_64 | |
mv ./.build/release/SwiftAstGen SwiftAstGen-linux | |
gzexe SwiftAstGen-linux | |
./SwiftAstGen-linux -s | |
- name: Run Mac Build | |
if: matrix.os == 'macos-latest' | |
run: | | |
swift build -c release --arch arm64 --arch x86_64 | |
mv ./.build/apple/Products/Release/SwiftAstGen SwiftAstGen-mac | |
gzexe SwiftAstGen-mac | |
- name: Run Windows Build | |
if: matrix.os == 'windows-latest' | |
run: | | |
swift build -c release --arch x86_64 | |
mv .\.build\release\SwiftAstGen.exe SwiftAstGen-win.exe | |
- name: Run UPX for Windows Build | |
if: matrix.os == 'windows-latest' | |
uses: crazy-max/ghaction-upx@v3 | |
with: | |
version: latest | |
files: | | |
SwiftAstGen-win.exe | |
args: -fq | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
files: | | |
SwiftAstGen-linux | |
SwiftAstGen-mac | |
SwiftAstGen-win.exe | |
SwiftNodeSyntax.scala |