-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 1.93 KB
/
cd.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
69
70
71
72
73
74
75
76
77
name: CD
on:
workflow_run:
workflows:
- CI
types:
- completed
branches:
- main # semantic-release supports distribution channels via other branches
concurrency: cd # don't run multiple releases in parallel and mess up the versions
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
os:
- linux
- macos
include:
- os: linux
runs_on: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos
runs_on: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.runs_on }}
steps:
# setup
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup
- name: Install target
shell: bash
run: rustup target add ${{ matrix.target }}
# build
- name: Build
shell: bash
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary
shell: bash
run: mv target/${{ matrix.target }}/release/kindle-to-anki target/${{ matrix.target }}/release/kindle-to-anki-${{ matrix.os }}
- name: Save binary for later
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.os }}
path: target/${{ matrix.target }}/release/kindle-to-anki-${{ matrix.os }}
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch binaries for all platforms
uses: actions/download-artifact@v4
with:
path: release
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
extra_plugins: conventional-changelog-conventionalcommits@5