-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (68 loc) · 1.98 KB
/
release.yml
File metadata and controls
84 lines (68 loc) · 1.98 KB
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
79
80
81
82
83
84
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: sql-cli-linux-x64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact: sql-cli-windows-x64
- os: macos-latest
target: x86_64-apple-darwin
artifact: sql-cli-macos-x64
- os: macos-latest
target: aarch64-apple-darwin
artifact: sql-cli-macos-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build Release
working-directory: ./sql-cli
run: cargo build --release --target ${{ matrix.target }}
- name: Create artifact directory
run: mkdir -p artifacts
- name: Copy binary (Unix)
if: matrix.os != 'windows-latest'
run: cp sql-cli/target/${{ matrix.target }}/release/sql-cli artifacts/${{ matrix.artifact }}
- name: Copy binary (Windows)
if: matrix.os == 'windows-latest'
run: cp sql-cli/target/${{ matrix.target }}/release/sql-cli.exe artifacts/${{ matrix.artifact }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: artifacts/*
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/**/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}