-
Notifications
You must be signed in to change notification settings - Fork 10
184 lines (163 loc) · 6.36 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# ********************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************/
# Create artifacts for project releases
name: Release
on:
push:
tags:
- v*
concurrency:
group: "release-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
check:
uses: ./.github/workflows/check.yaml
check-msrv:
uses: ./.github/workflows/verify-msrv.yaml
coverage:
uses: ./.github/workflows/coverage.yaml
requirements-tracing:
uses: ./.github/workflows/requirements-tracing.yaml
with:
oft-file-patterns: "${{ vars.UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS }} ${{ vars.UP_RUST_OPEN_FAST_TRACE_FILE_PATTERNS }}"
licenses:
# This works off the license declarations in dependent packages/crates, so if these declarations are wrong, this report will contain erroneous information
uses: ./.github/workflows/license-report.yaml
tag_release_artifacts:
# This only runs if this workflow is initiated via a tag-push with pattern 'v*'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
name: collect v-tag release artifacts
runs-on: ubuntu-latest
needs:
- check
- check-msrv
- coverage
- requirements-tracing
- licenses
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
# License report - we later need the download_url output of the upload step
- name: Download license report
uses: actions/download-artifact@v4
with:
name: license-report
path: dist/license/
- name: Upload license report to release
uses: svenstaro/upload-release-action@v2
id: upload_license_report
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/license/*
file_glob: true
tag: ${{ github.ref }}
# Requirements Tracing report - we later need the download_url output of the upload step
- name: Download requirements tracing report
uses: actions/download-artifact@v4
with:
name: tracing-report-html
path: dist/tracing/
- name: Upload requirements tracing report to release
uses: svenstaro/upload-release-action@v2
id: upload_requirements_tracing_report
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/tracing/*
file_glob: true
tag: ${{ github.ref }}
# Test report - we later need the download_url output of the upload step
- name: Download test report
uses: actions/download-artifact@v4
with:
name: test-results
path: dist/tests/
- name: Upload test report to release
uses: svenstaro/upload-release-action@v2
id: upload_test_report
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/tests/*
file_glob: true
tag: ${{ github.ref }}
# Test coverage - we later need the download_url output of the upload step
- name: Download test coverage
uses: actions/download-artifact@v4
with:
name: code-coverage-html
path: dist/codecov/
- name: Upload test coverage to release
uses: svenstaro/upload-release-action@v2
id: upload_test_coverage
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/codecov/*
file_glob: true
tag: ${{ github.ref }}
# README - we later need the download_url output of the upload step
- name: Upload README to release
uses: svenstaro/upload-release-action@v2
id: upload_readme
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: README.md
tag: ${{ github.ref }}
- name: Gather uProtocol Specification documents
shell: bash
run: |
tar cvz --file up-spec.tar.gz ${{ vars.UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS }}
- name: Upload relevant uProtocol Spec files to release
uses: svenstaro/upload-release-action@v2
id: upload_up_spec
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: up-spec.tar.gz
tag: ${{ github.ref }}
- name: Gets latest created release info
id: latest_release_info
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Collect quality artifacts
uses: anotherdaniel/[email protected]
id: quevee_manifest
with:
release_url: ${{ steps.latest_release_info.outputs.html_url }}
artifacts_license: ${{ steps.upload_license_report.outputs.browser_download_url }}
artifacts_readme: ${{ steps.upload_readme.outputs.browser_download_url }}
artifacts_requirements: ${{ steps.upload_up_spec.outputs.browser_download_url }}
artifacts_testing: ${{ steps.upload_test_report.outputs.browser_download_url }},${{ steps.upload_test_coverage.outputs.browser_download_url }},${{ steps.upload_requirements_tracing_report.outputs.browser_download_url }}
- name: Upload manifest to release
uses: svenstaro/upload-release-action@v2
id: upload_quality_manifest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.quevee_manifest.outputs.manifest_file }}
tag: ${{ github.ref }}
cargo-publish:
name: publish to crates.io
# This will publish to crates.io if secrets.CRATES_TOKEN is set in the workspace, otherwise do a dry-run
runs-on: ubuntu-latest
needs:
- tag_release_artifacts
env:
CRATES_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- if: env.CRATES_TOKEN == ''
run: cargo publish --all-features --dry-run
- if: env.CRATES_TOKEN != ''
run: cargo publish --all-features --token ${CRATES_TOKEN}