Release #44
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
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
name: Release | |
jobs: | |
build: | |
name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest ] | |
swift: ["5.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: swift-actions/setup-swift@v2 | |
with: | |
swift-version: ${{ matrix.swift }} | |
- name: Run tests | |
run: swift test | |
- name: Set version | |
run: bash -c 'echo "let appVersion = \"`git describe --abbrev=0 --tags` (`date +%F`)\""' > ./Sources/table/Version.swift | |
- name: Build | |
run: swift build -c release --arch arm64 --arch x86_64 | |
- name: List files | |
run: ls -la .build/ | |
- name: Rename file | |
run: bash -c 'mv .build/release/table ./table' | |
- name: Zip osx file | |
if: ${{ matrix.os == 'macos-latest' }} | |
uses: a7ul/tar-action@v1.1.0 | |
with: | |
command: c | |
files: ./table | |
outPath: osx.tar.gz | |
- name: Zip linux file | |
uses: a7ul/tar-action@v1.1.0 | |
with: | |
command: c | |
files: ./table | |
outPath: linux.tar.gz | |
- name: Upload linux artifact | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v3.1.0 | |
with: | |
name: release-binary-${{ matrix.os }} | |
if-no-files-found: error | |
retention-days: 1 | |
path: linux.tar.gz | |
- name: Upload OSX artifact | |
if: ${{ matrix.os == 'macos-latest' }} | |
uses: actions/upload-artifact@v3.1.0 | |
with: | |
name: release-binary-${{ matrix.os }} | |
if-no-files-found: error | |
retention-days: 1 | |
path: osx.tar.gz | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
- name: Create GH release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
./linux.tar.gz | |
./osx.tar.gz |