-
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (104 loc) · 3.68 KB
/
bundle.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Bundle Binaries
on:
push:
branches:
- master
workflow_dispatch:
inputs:
profile:
description: "The build profile to use"
required: false
default: dev
options:
- dev
- release
type: choice
workflow_call:
inputs:
profile:
description: "The build profile to use"
default: dev
required: false
type: string
artifact-prefix:
description: "A prefix to append to created artifact names"
default: ""
required: false
type: string
outputs:
macos-example-artifact-name:
description: "The name of the created macOS Example artifact"
value: ${{ jobs.example-app-macos.outputs.artifact-name }}
macos-example-artifact-id:
description: "The id of the created macOS Example artifact"
value: ${{ jobs.example-app-macos.outputs.artifact-id }}
macos-example-artifact-url:
description: "The url to the created macOS Example artifact"
value: ${{ jobs.example-app-macos.outputs.artifact-url }}
permissions:
id-token: write
attestations: write
jobs:
example-app-macos:
strategy:
matrix:
renderer:
- vulkan
- opengl
name: Bundle MacOS ${{ matrix.renderer }} Binary
runs-on: macos-latest
outputs:
artifact-name: ${{ steps.out.outputs.artifact-name }}
artifact-id: ${{ steps.out.outputs.artifact-id }}
artifact-url: ${{ steps.out.outputs.artifact-url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare runner
uses: ./.github/actions/prepare-runner
- name: Install toolchain
uses: ./.github/actions/rust-toolchain
- name: Select profile
id: select
run: |
if [[ -z "${{ inputs.profile }}" ]]; then
echo "profile=dev" >> "${GITHUB_OUTPUT}"
else
echo "profile=${{ inputs.profile }}" >> "${GITHUB_OUTPUT}"
fi
- name: Build
uses: ./.github/actions/cargo-build
with:
profile: ${{ steps.select.outputs.profile }}
- name: Bundle
id: bundle
uses: ./.github/actions/cargo-bundle
with:
profile: ${{ steps.select.outputs.profile }}
path: examples/${{ matrix.renderer }}-example
- name: Attest Provenance
id: provenance
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ inputs.artifact-prefix }}${{ steps.bundle.outputs.artifact_name }}
subject-path: ${{ steps.bundle.outputs.artifact_path }}
- name: Upload Bundle Artifact
id: upload
uses: actions/upload-artifact@v4
if: steps.bundle.outcome == 'success'
continue-on-error: true
with:
name: ${{ inputs.artifact-prefix }}${{ steps.bundle.outputs.artifact_name }}
path: ${{ steps.bundle.outputs.artifact_path }}
- name: Set outputs
id: out
continue-on-error: true
run: |
echo "artifact-name=${{ inputs.artifact-prefix }}${{ steps.bundle.outputs.artifact_name }}" >> "${GITHUB_OUTPUT}"
echo "artifact-id=${{ steps.upload.outputs.artifact-id }}" >> "${GITHUB_OUTPUT}"
echo "artifact-url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload.outputs.artifact-id }}" >> "${GITHUB_OUTPUT}"
- name: Summarize
run: |
echo "# 📦 Artifacts" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo "* [${{ steps.out.outputs.artifact-name }}](${{ steps.out.outputs.artifact-url }})" >> "${GITHUB_STEP_SUMMARY}"