-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (63 loc) · 1.58 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: dh
asset_name: dh-linux-amd64
- os: windows-latest
artifact_name: dh.exe
asset_name: dh-windows-amd64.exe
- os: macos-latest
artifact_name: dh
asset_name: dh-macos-amd64
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Build
run: cargo build --release
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: target/release/${{ matrix.artifact_name }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: |
dh-linux-amd64
dh-windows-amd64.exe
dh-macos-amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}