Skip to content

Commit 867089e

Browse files
authored
Merge pull request #164 from per1234/sync-release-assets
Sync build assets from templates
2 parents 9269175 + 636d337 commit 867089e

11 files changed

+145
-120
lines changed

.github/workflows/check-go-dependencies-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
RESULT="false"
5757
fi
5858
59-
echo "::set-output name=result::$RESULT"
59+
echo "result=$RESULT" >> $GITHUB_OUTPUT
6060
6161
check-cache:
6262
needs: run-determination

.github/workflows/check-notarization-certificates.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
echo "Certificate expiration date: $EXPIRATION_DATE"
109109
echo "Days remaining before expiration: $DAYS_BEFORE_EXPIRATION"
110110
111-
echo "::set-output name=days::$DAYS_BEFORE_EXPIRATION"
111+
echo "days=$DAYS_BEFORE_EXPIRATION" >> $GITHUB_OUTPUT
112112
113113
- name: Check if expiration notification period has been reached
114114
id: check-expiration

.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ jobs:
3636
id: determination
3737
run: |
3838
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
39-
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then
39+
if [[
40+
"${{ github.event_name }}" == "push" ||
41+
(
42+
"${{ github.event_name }}" == "create" &&
43+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
44+
)
45+
]]; then
4046
RESULT="true"
4147
else
4248
RESULT="false"
4349
fi
4450
45-
echo "::set-output name=result::$RESULT"
51+
echo "result=$RESULT" >> $GITHUB_OUTPUT
4652
4753
publish:
4854
runs-on: ubuntu-latest
@@ -77,15 +83,20 @@ jobs:
7783

7884
- name: Determine versioning parameters
7985
id: determine-versioning
80-
run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)"
86+
run: echo "data=$(poetry run python docs/siteversion/siteversion.py)" >> $GITHUB_OUTPUT
8187

8288
- name: Publish documentation
8389
if: fromJson(steps.determine-versioning.outputs.data).version != null
8490
run: |
8591
# Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits.
8692
git config --global user.email "[email protected]"
8793
git config --global user.name "ArduinoBot"
88-
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
94+
git fetch \
95+
--no-tags \
96+
--prune \
97+
--depth=1 \
98+
origin \
99+
+refs/heads/gh-pages:refs/remotes/origin/gh-pages
89100
poetry run mike deploy \
90101
--update-aliases \
91102
--push \

.github/workflows/generate-index.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ jobs:
7070
# disable gpg pass prompt
7171
# https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command
7272
- name: sign the json
73-
run: gpg --pinentry-mode=loopback --passphrase "${{ secrets.PASSPHRASE }}" --output boards/module_firmware_index.json.sig --detach-sign boards/module_firmware_index.json
73+
run: |
74+
gpg \
75+
--pinentry-mode=loopback \
76+
--passphrase "${{ secrets.PASSPHRASE }}" \
77+
--output boards/module_firmware_index.json.sig \
78+
--detach-sign boards/module_firmware_index.json
7479
7580
- name: create the gzip
7681
run: gzip --keep boards/module_firmware_index.json

.github/workflows/publish-go-tester-task.yml

+82-58
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ on:
2626
env:
2727
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
2828
GO_VERSION: "1.18"
29+
# As defined by the Taskfile's PROJECT_NAME variable
30+
PROJECT_NAME: arduino-fwuploader
2931
# As defined by the Taskfile's DIST_DIR variable
3032
DIST_DIR: dist
31-
BUILDS_ARTIFACT: build-artifacts
3233

3334
jobs:
3435
run-determination:
@@ -40,10 +41,12 @@ jobs:
4041
id: determination
4142
run: |
4243
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
44+
TAG_REGEX="refs/tags/.*"
4345
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4446
if [[
45-
"${{ github.event_name }}" != "create" ||
46-
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
47+
("${{ github.event_name }}" != "create" ||
48+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) &&
49+
! "${{ github.ref }}" =~ $TAG_REGEX
4750
]]; then
4851
# Run the other jobs.
4952
RESULT="true"
@@ -52,12 +55,61 @@ jobs:
5255
RESULT="false"
5356
fi
5457
55-
echo "::set-output name=result::$RESULT"
58+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5659
57-
build:
60+
package-name-prefix:
5861
needs: run-determination
5962
if: needs.run-determination.outputs.result == 'true'
6063
runs-on: ubuntu-latest
64+
outputs:
65+
prefix: ${{ steps.calculation.outputs.prefix }}
66+
steps:
67+
- name: package name prefix calculation
68+
id: calculation
69+
run: |
70+
PACKAGE_NAME_PREFIX="test"
71+
if [ "${{ github.event_name }}" = "pull_request" ]; then
72+
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
73+
fi
74+
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
75+
76+
echo "prefix=$PACKAGE_NAME_PREFIX" >> $GITHUB_OUTPUT
77+
78+
build:
79+
needs: package-name-prefix
80+
name: Build ${{ matrix.os.name }}
81+
runs-on: ubuntu-latest
82+
83+
strategy:
84+
matrix:
85+
os:
86+
- task: Windows_32bit
87+
path: "*Windows_32bit.zip"
88+
name: Windows_X86-32
89+
- task: Windows_64bit
90+
path: "*Windows_64bit.zip"
91+
name: Windows_X86-64
92+
- task: Linux_32bit
93+
path: "*Linux_32bit.tar.gz"
94+
name: Linux_X86-32
95+
- task: Linux_64bit
96+
path: "*Linux_64bit.tar.gz"
97+
name: Linux_X86-64
98+
- task: Linux_ARMv6
99+
path: "*Linux_ARMv6.tar.gz"
100+
name: Linux_ARMv6
101+
- task: Linux_ARMv7
102+
path: "*Linux_ARMv7.tar.gz"
103+
name: Linux_ARMv7
104+
- task: Linux_ARM64
105+
path: "*Linux_ARM64.tar.gz"
106+
name: Linux_ARM64
107+
- task: macOS_64bit
108+
path: "*macOS_64bit.tar.gz"
109+
name: macOS_64
110+
- task: macOS_ARM64
111+
path: "*macOS_ARM64.tar.gz"
112+
name: macOS_ARM64
61113

62114
steps:
63115
- name: Checkout repository
@@ -76,69 +128,41 @@ jobs:
76128

77129
- name: Build
78130
run: |
79-
PACKAGE_NAME_PREFIX="test"
80-
if [ "${{ github.event_name }}" = "pull_request" ]; then
81-
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
82-
fi
83-
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
131+
PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}
84132
export PACKAGE_NAME_PREFIX
85-
task dist:all
133+
task dist:${{ matrix.os.task }}
86134
87135
# Transfer builds to artifacts job
88-
- name: Upload combined builds artifact
136+
- name: Upload build artifact
89137
uses: actions/upload-artifact@v3
90138
with:
91-
path: ${{ env.DIST_DIR }}
92-
name: ${{ env.BUILDS_ARTIFACT }}
139+
path: ${{ env.DIST_DIR }}/${{ matrix.os.path }}
140+
name: ${{ matrix.os.name }}
93141

94-
artifacts:
95-
name: ${{ matrix.artifact.name }} artifact
96-
needs: build
142+
checksums:
143+
needs:
144+
- build
145+
- package-name-prefix
97146
runs-on: ubuntu-latest
98147

99-
strategy:
100-
matrix:
101-
artifact:
102-
- path: "*checksums.txt"
103-
name: checksums
104-
- path: "*Linux_32bit.tar.gz"
105-
name: Linux_X86-32
106-
- path: "*Linux_64bit.tar.gz"
107-
name: Linux_X86-64
108-
- path: "*Linux_ARM64.tar.gz"
109-
name: Linux_ARM64
110-
- path: "*Linux_ARMv6.tar.gz"
111-
name: Linux_ARMv6
112-
- path: "*Linux_ARMv7.tar.gz"
113-
name: Linux_ARMv7
114-
- path: "*macOS_64bit.tar.gz"
115-
name: macOS_64
116-
- path: "*macOS_ARM64.tar.gz"
117-
name: macOS_ARM64
118-
- path: "*Windows_32bit.zip"
119-
name: Windows_X86-32
120-
- path: "*Windows_64bit.zip"
121-
name: Windows_X86-64
122-
123148
steps:
124-
- name: Download combined builds artifact
149+
- name: Download build artifacts
125150
uses: actions/download-artifact@v3
126-
with:
127-
name: ${{ env.BUILDS_ARTIFACT }}
128-
path: ${{ env.BUILDS_ARTIFACT }}
129151

130-
- name: Upload individual build artifact
152+
- name: Create checksum file
153+
run: |
154+
TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
155+
declare -a artifacts=($(ls -d */))
156+
for artifact in ${artifacts[@]}
157+
do
158+
cd $artifact
159+
checksum=$(sha256sum ${{ env.PROJECT_NAME }}_${TAG}*)
160+
cd ..
161+
echo $checksum >> ${TAG}-checksums.txt
162+
done
163+
164+
- name: Upload checksum artifact
131165
uses: actions/upload-artifact@v3
132166
with:
133-
path: ${{ env.BUILDS_ARTIFACT }}/${{ matrix.artifact.path }}
134-
name: ${{ matrix.artifact.name }}
135-
136-
clean:
137-
needs: artifacts
138-
runs-on: ubuntu-latest
139-
140-
steps:
141-
- name: Remove unneeded combined builds artifact
142-
uses: geekyeggo/delete-artifact@v2
143-
with:
144-
name: ${{ env.BUILDS_ARTIFACT }}
167+
path: ./*checksums.txt
168+
name: checksums

.github/workflows/release-go-crosscompile-task.yml

+26-23
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,28 @@ jobs:
2121
create-release-artifacts:
2222
runs-on: ubuntu-latest
2323

24+
strategy:
25+
matrix:
26+
os:
27+
- Windows_32bit
28+
- Windows_64bit
29+
- Linux_32bit
30+
- Linux_64bit
31+
- Linux_ARMv6
32+
- Linux_ARMv7
33+
- Linux_ARM64
34+
- macOS_64bit
35+
- macOS_ARM64
36+
2437
steps:
2538
- name: Checkout repository
2639
uses: actions/checkout@v3
2740
with:
2841
fetch-depth: 0
2942

3043
- name: Create changelog
44+
# Avoid creating the same changelog for each os
45+
if: matrix.os == 'Windows_32bit'
3146
uses: arduino/create-changelog@v1
3247
with:
3348
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$'
@@ -47,7 +62,7 @@ jobs:
4762
version: 3.x
4863

4964
- name: Build
50-
run: task dist:all
65+
run: task dist:${{ matrix.os }}
5166

5267
- name: Upload artifacts
5368
uses: actions/upload-artifact@v3
@@ -60,9 +75,6 @@ jobs:
6075
name: Notarize ${{ matrix.artifact.name }}
6176
runs-on: macos-latest
6277
needs: create-release-artifacts
63-
outputs:
64-
checksum-darwin_amd64: ${{ steps.re-package.outputs.checksum-darwin_amd64 }}
65-
checksum-darwin_arm64: ${{ steps.re-package.outputs.checksum-darwin_arm64 }}
6678

6779
env:
6880
GON_CONFIG_PATH: gon.config.hcl
@@ -89,7 +101,8 @@ jobs:
89101
env:
90102
KEYCHAIN: "sign.keychain"
91103
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
92-
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
104+
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
105+
KEYCHAIN_PASSWORD: keychainpassword
93106
run: |
94107
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
95108
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
@@ -139,14 +152,10 @@ jobs:
139152
run: |
140153
gon "${{ env.GON_CONFIG_PATH }}"
141154
142-
- name: Re-package binary and output checksum
155+
- name: Re-package binary
143156
id: re-package
144157
working-directory: ${{ env.DIST_DIR }}
145-
# This step performs the following:
146-
# 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
147-
# 2. Recalculate package checksum
148-
# 3. Output the new checksum to include in the nnnnnn-checksums.txt file
149-
# (it cannot be done there because of workflow job parallelization)
158+
# Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
150159
run: |
151160
# GitHub's upload/download-artifact actions don't preserve file permissions,
152161
# so we need to add execution permission back until the action is made to do this.
@@ -156,11 +165,9 @@ jobs:
156165
tar -czvf "$PACKAGE_FILENAME" \
157166
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
158167
-C ../../ LICENSE.txt
159-
CHECKSUM_LINE="$(shasum -a 256 $PACKAGE_FILENAME)"
160168
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
161-
echo "::set-output name=checksum-${{ matrix.artifact.name }}::$CHECKSUM_LINE"
162169
163-
- name: Upload artifacts
170+
- name: Upload artifact
164171
uses: actions/upload-artifact@v3
165172
with:
166173
if-no-files-found: error
@@ -192,15 +199,11 @@ jobs:
192199
# would be calculated since the binary is modified during notarization
193200
run: task dist:generate-index-data
194201

195-
- name: Update checksum
202+
- name: Create checksum file
203+
working-directory: ${{ env.DIST_DIR}}
196204
run: |
197-
declare -a checksum_lines=("${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" "${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}")
198-
for checksum_line in "${checksum_lines[@]}"
199-
do
200-
CHECKSUM=$(echo ${checksum_line} | cut -d " " -f 1)
201-
PACKAGE_FILENAME=$(echo ${checksum_line} | cut -d " " -f 2)
202-
perl -pi -w -e "s/.*${PACKAGE_FILENAME}/${CHECKSUM} ${PACKAGE_FILENAME}/g;" ${{ env.DIST_DIR }}/*-checksums.txt
203-
done
205+
TAG="${GITHUB_REF/refs\/tags\//}"
206+
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt
204207
205208
- name: Identify Prerelease
206209
# This is a workaround while waiting for create-release action
@@ -209,7 +212,7 @@ jobs:
209212
run: |
210213
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
211214
unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver
212-
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "::set-output name=IS_PRE::true"; fi
215+
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi
213216
214217
- name: Create Github Release and upload artifacts
215218
uses: ncipollo/release-action@v1

.github/workflows/sync-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
run: |
104104
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
105105
# configuration.
106-
echo "::set-output name=flag::--dry-run"
106+
echo "flag=--dry-run" >> $GITHUB_OUTPUT
107107
108108
- name: Checkout repository
109109
uses: actions/checkout@v3

.github/workflows/test-go-integration-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
RESULT="false"
5656
fi
5757
58-
echo "::set-output name=result::$RESULT"
58+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5959
6060
test:
6161
needs: run-determination

0 commit comments

Comments
 (0)