forked from llvm/circt
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (149 loc) · 5.36 KB
/
uploadReleaseArtifacts.yml
File metadata and controls
163 lines (149 loc) · 5.36 KB
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
name: Upload Release Artifacts
on:
release:
types: [created]
workflow_dispatch:
inputs:
os:
type: choice
description: Operating System target
default: linux
options:
- linux
- macos
- windows
# The following options only influence workflow_dispatch, and are ignored otherwise.
run_tests:
description: Run CIRCT tests
default: false
type: boolean
llvm_enable_assertions:
description: Build with assertions.
default: false
type: boolean
cmake_build_type:
required: true
type: choice
options:
- release
- relwithdebinfo
- debug
default: release
manual_release:
description: Trigger a manual full release build
default: false
type: boolean
# Run every day at 0700 UTC which is:
# - 0000 PDT / 2300 PST
# - 0300 EDT / 0200 EST
schedule:
- cron: '0 7 * * *'
jobs:
publish-sources:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
contents: write # Upload assets to release.
steps:
# Clone the CIRCT repo and its submodules. Do shallow clone to save clone
# time.
- name: Get CIRCT and LLVM
uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: "true"
# Package up sources for distribution, as the default source bundles from GitHub don't include LLVM.
- name: Create Source Archive
run: |
touch circt-full-sources.tar.gz
tar \
--exclude-vcs \
--exclude=circt-full-sources.tar.gz \
-czf \
circt-full-sources.tar.gz .
shasum -a 256 circt-full-sources.tar.gz | cut -d ' ' -f1 > circt-full-sources.tar.gz.sha256
- name: Upload Source Archive
uses: AButler/upload-release-assets@v3.0
with:
# The * will grab the .sha256 as well
files: circt-full-sources.tar.gz*
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref_name }} # Upload to release tag when manually run.
# This job sets up the build matrix.
choose-matrix:
runs-on: ubuntu-latest
steps:
# Clone CIRCT as shallow as possible. We just need the `.github`
# directory.
- name: Get CIRCT and LLVM
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: "false"
- name: Get Configuration
id: get-config
run: |
case ${{ github.event_name }} in
"release" | "schedule")
config=$(.github/bin/uploadReleaseArtifacts.sh -e ${{ github.event_name }})
;;
"workflow_dispatch")
config=$(.github/bin/uploadReleaseArtifacts.sh \
-b ${{ inputs.cmake_build_type }} \
-e ${{ github.event_name }} \
-o ${{ inputs.os }} \
${{ inputs.llvm_enable_assertions && '-a' || ' ' }} \
${{ inputs.run_tests && '-t' || ' ' }})
;;
esac
echo "Build Matrix:" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`json" >> $GITHUB_STEP_SUMMARY
echo "$config" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
static=$(echo "$config" | jq -c '.static')
native=$(echo "$config" | jq -c '.native')
echo "static=$static" >> $GITHUB_OUTPUT
echo "native=$native" >> $GITHUB_OUTPUT
outputs:
static: ${{ steps.get-config.outputs.static }}
native: ${{ steps.get-config.outputs.native }}
publish-static:
needs:
- choose-matrix
if: ${{ needs.choose-matrix.outputs.static != '[]' }}
strategy:
matrix:
generated: ${{ fromJSON(needs.choose-matrix.outputs.static) }}
permissions:
contents: write # Upload assets to release.
actions: write
uses: ./.github/workflows/unifiedBuildTestAndInstallStatic.yml
with:
cmake_build_type: ${{ matrix.generated.cmake_build_type }}
llvm_enable_assertions: ${{ matrix.generated.llvm_enable_assertions }}
llvm_force_enable_stats: ${{ matrix.generated.llvm_force_enable_stats }}
run_tests: ${{ matrix.generated.run_tests }}
install_target: ${{ matrix.generated.install_target }}
package_name_prefix: ${{ matrix.generated.package_name_prefix }}
publish-native:
needs:
- choose-matrix
if: ${{ needs.choose-matrix.outputs.native != '[]' }}
strategy:
matrix:
generated: ${{ fromJSON(needs.choose-matrix.outputs.native) }}
permissions:
contents: write # Upload assets to release.
actions: write
uses: ./.github/workflows/unifiedBuildTestAndInstall.yml
with:
runner: ${{ matrix.generated.runner }}
cmake_build_type: ${{ matrix.generated.cmake_build_type }}
build_shared_libs: ${{ matrix.generated.build_shared_libs }}
llvm_enable_assertions: ${{ matrix.generated.llvm_enable_assertions }}
llvm_force_enable_stats: ${{ matrix.generated.llvm_force_enable_stats }}
run_tests: ${{ matrix.generated.run_tests }}
install_target: ${{ matrix.generated.install_target }}
package_name_prefix: ${{ matrix.generated.package_name_prefix }}
cmake_c_compiler: ${{ matrix.generated.cmake_c_compiler }}
cmake_cxx_compiler: ${{ matrix.generated.cmake_cxx_compiler }}