Skip to content

Commit 35613e0

Browse files
ci: Adds binaries to releases
1 parent 1098344 commit 35613e0

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and publish a Docker image to GitHub Releases
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
build-and-publish:
8+
strategy:
9+
matrix:
10+
platform: [ubuntu-latest, macos-latest]
11+
runs-on: ${{ matrix.platform }}
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Set up Swift
18+
uses: swift-actions/setup-swift@v2
19+
- name: Build
20+
run: swift build --configuration release
21+
- name: Archive binary
22+
run: |
23+
mkdir -p build
24+
cp .build/release/unit build/unit
25+
tar -czf ${{ github.ref_name }}-${{ matrix.platform }}.tar.gz -C build .
26+
shasum -a 256 ${{ github.ref_name }}-${{ matrix.platform }}.tar.gz > ${{ github.ref_name }}-${{ matrix.platform }}.sha256
27+
- name: Upload assets to release
28+
id: upload_release
29+
uses: softprops/action-gh-release@v2
30+
with:
31+
tag_name: ${{ github.ref_name }}
32+
draft: true
33+
generate_release_notes: true
34+
files: |
35+
${{ github.ref_name }}-${{ matrix.platform }}.tar.gz
36+
${{ github.ref_name }}-${{ matrix.platform }}.sha256

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
os: [ubuntu-latest, macos-latest]
1111
runs-on: ${{ matrix.os }}
1212
steps:
13-
- uses: fwal/setup-swift@v1
14-
- uses: actions/checkout@v2
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Set up Swift
16+
uses: swift-actions/setup-swift@v2
1517
- name: Run tests
1618
run: swift test --skip PerformanceTests

0 commit comments

Comments
 (0)