This repository has been archived by the owner on Nov 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (71 loc) · 2.42 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
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Version x.x.x"
type: string
required: true
dry-run:
type: boolean
description: Dry run? (won't actually push the release artifacts)
jobs:
release:
name: Prepare release for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
artifact_name: target/release/ditto
asset_name: ditto-linux
- os: windows-latest
artifact_name: target/release/ditto.exe
asset_name: ditto-windows
- os: macos-latest
artifact_name: target/release/ditto
asset_name: ditto-macos
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Rust toolchain 🦀
uses: ./.github/actions/rust-toolchain
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: "npm"
- name: Run cargo build --release --locked
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked
env:
DITTO_BUILD_GIT_DESCRIBE: ${{ github.event.inputs.version }}
- name: Prepare release script
run: npm install
working-directory: ./scripts/release
# Need to be explicit here as windows defaults to PowerShell
shell: bash
- name: Run release script
run: node ./scripts/release --ditto-bin ${{ matrix.artifact_name }} --out-zip ${{ matrix.asset_name }}.zip --out-sha256 ${{ matrix.asset_name }}.sha256
shell: bash
# If this is a dry-run, then just upload the artifact
- name: Upload artifact
uses: actions/upload-artifact@v3
if: github.event.inputs.dry-run == 'true'
with:
name: release-${{ matrix.os }}
path: ${{ matrix.asset_name }}.zip
- name: Upload release 🎉
uses: softprops/action-gh-release@v1
if: github.event.inputs.dry-run != 'true'
with:
tag_name: ${{ github.event.inputs.version }}
files: |
${{ matrix.asset_name }}.zip
${{ matrix.asset_name }}.sha256
# Create a draft release.
# Need to go and write release notes and publish manually!
draft: true