-
Notifications
You must be signed in to change notification settings - Fork 135
99 lines (82 loc) · 2.69 KB
/
release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Zephyr SDK Continuous Integration Workflow (Release)
name: Release
on:
release:
types: [ published ]
permissions:
contents: write
env:
BUNDLE_PREFIX: zephyr-sdk
jobs:
# Run main CI workflow
ci:
name: CI
uses: ./.github/workflows/ci.yml
secrets:
AWS_CACHE_SDK_ACCESS_KEY_ID: ${{ secrets.AWS_CACHE_SDK_ACCESS_KEY_ID }}
AWS_CACHE_SDK_SECRET_ACCESS_KEY: ${{ secrets.AWS_CACHE_SDK_SECRET_ACCESS_KEY }}
# Publish release assets
release:
name: Release
needs: [ ci ]
runs-on: zephyr-runner-linux-x64-4xlarge
steps:
- name: Set up build environment
run: |
# Clean up working directories
rm -rf ${GITHUB_WORKSPACE}/*
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Prepare release assets
run: |
# Set base environment variables
ARTIFACT_ROOT=${GITHUB_WORKSPACE}/artifacts
ASSET_ROOT=${GITHUB_WORKSPACE}/assets
VERSION=$(<${ARTIFACT_ROOT}/version/version)
# Collect release assets
mkdir -p ${ASSET_ROOT}
pushd ${ASSET_ROOT}
mv ${ARTIFACT_ROOT}/toolchain_*/toolchain_* .
mv ${ARTIFACT_ROOT}/hosttools_*/hosttools_* .
mv ${ARTIFACT_ROOT}/${{ env.BUNDLE_PREFIX }}-*/${{ env.BUNDLE_PREFIX }}-* .
# Compute checksum
md5sum * > ${GITHUB_WORKSPACE}/md5.sum
sha256sum * > ${GITHUB_WORKSPACE}/sha256.sum
popd
# NOTE: The release asset upload action is called in multiple parts because the
# 'action-gh-release' action attempts to load all specified release assets
# into the runner memory at once and this may cause the runner instance to
# run out of memory (see the GitHub issue #520).
- name: Upload release assets (host tools)
uses: softprops/action-gh-release@v1
with:
files: |
assets/hosttools_*
- name: Upload release assets (Linux toolchains)
uses: softprops/action-gh-release@v1
with:
files: |
assets/toolchain_linux*
- name: Upload release assets (macOS toolchains)
uses: softprops/action-gh-release@v1
with:
files: |
assets/toolchain_macos*
- name: Upload release assets (Windows toolchains)
uses: softprops/action-gh-release@v1
with:
files: |
assets/toolchain_windows*
- name: Upload release assets (Distribution bundles)
uses: softprops/action-gh-release@v1
with:
files: |
assets/${{ env.BUNDLE_PREFIX }}-*
- name: Upload release assets (checksum)
uses: softprops/action-gh-release@v1
with:
files: |
md5.sum
sha256.sum