-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (76 loc) · 2.12 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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/release
- 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