-
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (49 loc) · 1.56 KB
/
release.yaml
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
---
name: Create release from tag
on:
push:
tags:
- "v*"
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Build executable
run: cargo build --release
- uses: olegtarasov/[email protected]
id: tagName
- name: Name executable (Linux/MacOS)
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
mv target/release/papyri target/release/papyri-${{ steps.tagName.outputs.tag }}-${{ matrix.os }}
- name: Name executable (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
mv target/release/papyri.exe target/release/papyri-${{ steps.tagName.outputs.tag }}-${{ matrix.os }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: papyri-${{ matrix.os }}
path: target/release/papyri-${{ steps.tagName.outputs.tag }}-*
release:
name: Release
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Make artifacts folder
run: mkdir artifacts
- uses: actions/download-artifact@v3
with:
path: artifacts/
- name: Flatten artifacts directory # From https://unix.stackexchange.com/a/52816
run: find artifacts -mindepth 2 -type f -exec mv -t artifacts -i '{}' +
- name: Release 🚀
uses: softprops/action-gh-release@v1
with:
files: artifacts/*