28
28
PROJECT_NAME : arduino-cli
29
29
# As defined by the Taskfile's DIST_DIR variable
30
30
DIST_DIR : dist
31
- BUILDS_ARTIFACT : build-artifacts
32
31
33
32
jobs :
34
33
run-determination :
@@ -54,40 +53,57 @@ jobs:
54
53
55
54
echo "::set-output name=result::$RESULT"
56
55
57
- build :
58
- name : Build ${{ matrix.os.name }}
56
+ package-name-prefix :
59
57
needs : run-determination
60
58
if : needs.run-determination.outputs.result == 'true'
61
59
runs-on : ubuntu-latest
60
+ outputs :
61
+ prefix : ${{ steps.calculation.outputs.prefix }}
62
+ steps :
63
+ - name : package name prefix calculation
64
+ id : calculation
65
+ run : |
66
+ PACKAGE_NAME_PREFIX="test"
67
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
68
+ PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
69
+ fi
70
+ PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
71
+
72
+ echo "::set-output name=prefix::$PACKAGE_NAME_PREFIX"
73
+
74
+ build :
75
+ needs : package-name-prefix
76
+ name : Build ${{ matrix.os.name }}
77
+ runs-on : ubuntu-latest
62
78
63
79
strategy :
64
80
matrix :
65
81
os :
66
- - dist : Windows_32bit
82
+ - task : Windows_32bit
67
83
path : " *Windows_32bit.zip"
68
84
name : Windows_X86-32
69
- - dist : Windows_64bit
85
+ - task : Windows_64bit
70
86
path : " *Windows_64bit.zip"
71
87
name : Windows_X86-64
72
- - dist : Linux_32bit
88
+ - task : Linux_32bit
73
89
path : " *Linux_32bit.tar.gz"
74
90
name : Linux_X86-32
75
- - dist : Linux_64bit
91
+ - task : Linux_64bit
76
92
path : " *Linux_64bit.tar.gz"
77
93
name : Linux_X86-64
78
- - dist : Linux_ARMv6
94
+ - task : Linux_ARMv6
79
95
path : " *Linux_ARMv6.tar.gz"
80
96
name : Linux_ARMv6
81
- - dist : Linux_ARMv7
97
+ - task : Linux_ARMv7
82
98
path : " *Linux_ARMv7.tar.gz"
83
99
name : Linux_ARMv7
84
- - dist : Linux_ARM64
100
+ - task : Linux_ARM64
85
101
path : " *Linux_ARM64.tar.gz"
86
102
name : Linux_ARM64
87
- - dist : macOS_64bit
103
+ - task : macOS_64bit
88
104
path : " *macOS_64bit.tar.gz"
89
105
name : macOS_64
90
- - dist : macOS_ARM64
106
+ - task : macOS_ARM64
91
107
path : " *macOS_ARM64.tar.gz"
92
108
name : macOS_ARM64
93
109
@@ -105,39 +121,30 @@ jobs:
105
121
106
122
- name : Build
107
123
run : |
108
- PACKAGE_NAME_PREFIX="test"
109
- if [ "${{ github.event_name }}" = "pull_request" ]; then
110
- PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
111
- fi
112
- PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
124
+ PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}
113
125
export PACKAGE_NAME_PREFIX
114
- task dist:${{ matrix.os.dist }}
126
+ task dist:${{ matrix.os.task }}
115
127
128
+ # Transfer builds to artifacts job
116
129
- name : Upload build artifact
117
130
uses : actions/upload-artifact@v3
118
131
with :
119
132
path : ${{ env.DIST_DIR }}/${{ matrix.os.path }}
120
133
name : ${{ matrix.os.name }}
121
134
122
135
checksums :
123
- needs : build
136
+ needs :
137
+ - build
138
+ - package-name-prefix
124
139
runs-on : ubuntu-latest
125
140
126
141
steps :
127
142
- name : Download build artifacts
128
143
uses : actions/download-artifact@v3
129
- with :
130
- path : ${{ env.BUILDS_ARTIFACT }}
131
144
132
145
- name : Output checksum
133
- working-directory : ${{ env.BUILDS_ARTIFACT}}
134
146
run : |
135
- PACKAGE_NAME_PREFIX="test"
136
- if [ "${{ github.event_name }}" = "pull_request" ]; then
137
- PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
138
- fi
139
- PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
140
- TAG="${PACKAGE_NAME_PREFIX}git-snapshot"
147
+ TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
141
148
declare -a artifacts=($(ls -d */))
142
149
for artifact in ${artifacts[@]}
143
150
do
@@ -150,5 +157,5 @@ jobs:
150
157
- name : Upload checksum artifact
151
158
uses : actions/upload-artifact@v3
152
159
with :
153
- path : ${{ env.BUILDS_ARTIFACT }} /*checksums.txt
160
+ path : . /*checksums.txt
154
161
name : checksums
0 commit comments