-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 1.94 KB
/
cd.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
name: CD
run-name: ${{ inputs.reason }}
on:
push:
tags:
- v*
workflow_run:
workflows:
- CI
types:
- completed
workflow_dispatch:
inputs:
reason:
description: Dispatch reason
required: true
type: string
env:
CARGO_TERM_COLOR: always
jobs:
upload-artifact:
name: Build and Upload Binary
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
permissions:
id-token: write
attestations: write
if: github.event_name != 'workflow_run' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set-up or update Rust toolchain
run: rustup toolchain install stable --profile default
- name: Set-up Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build project
run: cargo build --verbose --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lure-${{ runner.os }}
path: target/release/lure${{ runner.os == 'Windows' && '.exe' || '' }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: lure-${{ runner.os }}
subject-path: target/release/lure${{ runner.os == 'Windows' && '.exe' || '' }}
push-container-image:
name: Push Container Image
uses: ./.github/workflows/docker-push.yaml
permissions:
attestations: write
contents: read
id-token: write
packages: write
with:
image-name: lure