Skip to content

Commit 0b72a58

Browse files
committed
ci: update upload-artifact to v4.3.0 and download-artifact to v4.1.1 (#1399)
* ci: update upload-artifact to v4.3.0 and download-artifact to v4.1.1 * fix rpm/deb * add exception for quay; idk what I'll do once node support is gone * fix broken script * fix download * migrate 2-17 to cirrus to avoid node deprecation warnings * prevent cirrus cancellation * update cache to work with linux * simplify cache * update some comments * add timeouts
1 parent aa81985 commit 0b72a58

File tree

5 files changed

+51
-38
lines changed

5 files changed

+51
-38
lines changed

.cirrus.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ cache_template: &CACHE_TEMPLATE
1515
folder: $HOME/.cargo/registry
1616
reupload_on_changes: "true"
1717
fingerprint_script:
18-
- md5 Cargo.lock
18+
- $HOME/.cargo/bin/rustc --version
19+
- cat Cargo.lock
1920
- echo $CIRRUS_OS
2021
- echo $CIRRUS_TASK_NAME
2122
target_cache:
2223
folder: target
2324
reupload_on_changes: "true"
2425
fingerprint_script:
25-
- . $HOME/.cargo/env && rustc --version
26-
- md5 Cargo.lock
26+
- $HOME/.cargo/bin/rustc --version
27+
- cat Cargo.lock
2728
- echo $CIRRUS_OS
2829
- echo $CIRRUS_TASK_NAME
2930

@@ -39,7 +40,7 @@ env:
3940
CARGO_HUSKY_DONT_INSTALL_HOOKS: "true"
4041

4142
test_task:
42-
auto_cancellation: $CIRRUS_BRANCH != "main"
43+
auto_cancellation: "false" # We set this to false to prevent nightly builds from affecting this
4344
only_if: $CIRRUS_BUILD_SOURCE != "api" && ($CIRRUS_BRANCH == "main" || $CIRRUS_PR != "")
4445
timeout_in: "20m"
4546
skip: "!changesInclude('.cargo/**', '.cirrus.yml', 'sample_configs/**', 'src/**', 'tests/**', 'build.rs', 'Cargo.lock', 'Cargo.toml', 'clippy.toml', 'rustfmt.toml')"
@@ -100,6 +101,13 @@ build_task:
100101
env:
101102
TARGET: "aarch64-apple-darwin"
102103
NAME: "aarch64-apple-darwin"
104+
- name: "Legacy Linux (2.17)"
105+
alias: "linux_2_17_build"
106+
container:
107+
image: quay.io/pypa/manylinux2014_x86_64
108+
env:
109+
TARGET: "x86_64-unknown-linux-gnu"
110+
NAME: "x86_64-unknown-linux-gnu-2-17"
103111
<<: *SETUP_TEMPLATE
104112
<<: *CACHE_TEMPLATE
105113
build_script:

.github/workflows/build_releases.yml

+14-17
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ jobs:
4545
target: "x86_64-unknown-linux-gnu",
4646
cross: false,
4747
}
48-
- {
49-
os: "ubuntu-20.04",
50-
target: "x86_64-unknown-linux-gnu",
51-
cross: false,
52-
container: quay.io/pypa/manylinux2014_x86_64,
53-
suffix: "2-17",
54-
}
5548
- {
5649
os: "ubuntu-20.04",
5750
target: "i686-unknown-linux-gnu",
@@ -198,15 +191,16 @@ jobs:
198191
mv manpage.tar.gz release/
199192
200193
- name: Save release as artifact
201-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
194+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
202195
with:
203196
retention-days: 3
204-
name: release
197+
name: "release-${{ matrix.info.target }}${{ matrix.info.suffix }}"
205198
path: release
206199

207200
build-msi:
208201
name: "Build MSI installer"
209202
runs-on: "windows-2019"
203+
timeout-minutes: 30
210204
steps:
211205
- name: Checkout repository
212206
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -243,15 +237,16 @@ jobs:
243237
mv bottom_x86_64_installer.msi release/
244238
245239
- name: Save release as artifact
246-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
240+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
247241
with:
248242
retention-days: 3
249-
name: release
243+
name: "release-build-msi"
250244
path: release
251245

252246
build-cirrus:
253247
name: "Build using Cirrus CI"
254248
runs-on: "ubuntu-latest"
249+
timeout-minutes: 30
255250
steps:
256251
- name: Checkout repository
257252
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -275,15 +270,16 @@ jobs:
275270
python ./scripts/cirrus/build.py "$BRANCH" "release/" "${{ inputs.caller }}"
276271
277272
- name: Save release as artifact
278-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
273+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
279274
with:
280275
retention-days: 3
281-
name: release
276+
name: release-build-cirrus
282277
path: release
283278

284279
build-deb:
285280
name: "Build .deb software packages"
286281
runs-on: "ubuntu-20.04"
282+
timeout-minutes: 30
287283
strategy:
288284
fail-fast: false
289285
matrix:
@@ -396,16 +392,17 @@ jobs:
396392
mv ${{ steps.verify.outputs.DEB_FILE }} release/
397393
398394
- name: Save release as artifact
399-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
395+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
400396
with:
401397
retention-days: 3
402-
name: release
398+
name: release-build-deb-${{ matrix.info.target }}
403399
path: release
404400

405401
build-rpm:
406402
name: "Build .rpm software packages"
407403
runs-on: ubuntu-latest
408404
container: ghcr.io/clementtsang/almalinux-8
405+
timeout-minutes: 30
409406
strategy:
410407
fail-fast: false
411408
matrix:
@@ -478,8 +475,8 @@ jobs:
478475
mv ${{ steps.verify.outputs.RPM_FILE }} release/
479476
480477
- name: Save release as artifact
481-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
478+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
482479
with:
483480
retention-days: 3
484-
name: release
481+
name: release-build-rpm-${{ matrix.info.target }}
485482
path: release

.github/workflows/deployment.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# How we deploy a release. Covers binary builds. Also manages packaging for choco.
22
#
3-
# Based on https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
3+
# Binaries are primarily built by GHA, though some Linux, M1 macOS, and FreeBSD builds are
4+
# handled by CirrusCI.
45

56
name: deployment
67

@@ -67,10 +68,11 @@ jobs:
6768
echo "Release version: ${{ env.RELEASE_VERSION }}"
6869
6970
- name: Get release artifacts
70-
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
71+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
7172
with:
72-
name: release
73+
pattern: release-*
7374
path: release
75+
merge-multiple: true
7476

7577
- name: Execute choco packaging script
7678
run: |
@@ -83,10 +85,10 @@ jobs:
8385
mv choco.zip release/
8486
8587
- name: Save release as artifact
86-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
88+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
8789
with:
8890
retention-days: 3
89-
name: release
91+
name: release-choco
9092
path: release
9193

9294
upload-release:
@@ -104,17 +106,18 @@ jobs:
104106
echo "Release version: ${{ env.RELEASE_VERSION }}"
105107
106108
- name: Get release artifacts
107-
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
109+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
108110
with:
109-
name: release
111+
pattern: release-*
110112
path: release
113+
merge-multiple: true
111114

112115
- name: Print out all release files
113116
run: |
114117
echo "Generated $(ls ./release | wc -l) files:"
115118
du -h -d 0 ./release/*
116119
117-
- name: Upload all saved release files
120+
- name: Create release and add release files
118121
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # 0.1.15
119122
with:
120123
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/nightly.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ jobs:
4949
needs: [build-release]
5050
steps:
5151
- name: Get release artifacts
52-
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
52+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
5353
with:
54-
name: release
54+
pattern: release-*
5555
path: release
56+
merge-multiple: true
5657

5758
- name: Print out all release files
5859
run: |
@@ -72,7 +73,7 @@ jobs:
7273
run: sleep 10
7374
if: github.event.inputs.isMock != 'mock'
7475

75-
- name: Upload all saved release files if not mock
76+
- name: Add all release files to nightly release if not mock
7677
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # 0.1.15
7778
if: github.event.inputs.isMock != 'mock'
7879
with:

scripts/cirrus/build.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# through Cirrus CI's GraphQL interface.
55
#
66
# Expects the Cirrus CI API key to be set in the CIRRUS_KEY environment variable.
7+
#
8+
# TODO: Explain this in docs how the heck this works.
79

810
import os
911
import json
@@ -12,16 +14,18 @@
1214
from textwrap import dedent
1315
from time import sleep, time
1416
from pathlib import Path
15-
from typing import Optional
17+
from typing import List, Optional, Tuple
1618

1719
from urllib.request import Request, urlopen, urlretrieve
1820

19-
URL = "https://api.cirrus-ci.com/graphql"
20-
TASKS = [
21-
("freebsd_12_3_build", "bottom_x86_64-unknown-freebsd-13-2.tar.gz"),
22-
("freebsd_13_1_build", "bottom_x86_64-unknown-freebsd-14-0.tar.gz"),
21+
# Form of each task is (TASK_ALIAS, FILE_NAME).
22+
TASKS: List[Tuple[str, str]] = [
23+
("freebsd_13_2_build", "bottom_x86_64-unknown-freebsd-13-2.tar.gz"),
24+
("freebsd_14_0_build", "bottom_x86_64-unknown-freebsd-14-0.tar.gz"),
2325
("macos_build", "bottom_aarch64-apple-darwin.tar.gz"),
26+
("linux_2_17_build", "bottom_x86_64-unknown-linux-gnu-2-17.tar.gz"),
2427
]
28+
URL = "https://api.cirrus-ci.com/graphql"
2529
DL_URL_TEMPLATE = "https://api.cirrus-ci.com/v1/artifact/build/%s/%s/binaries/%s"
2630

2731

@@ -104,7 +108,7 @@ def check_build_status(key: str, id: str) -> Optional[str]:
104108
def try_download(build_id: str, dl_path: Path):
105109
for task, file in TASKS:
106110
url = DL_URL_TEMPLATE % (build_id, task, file)
107-
out = dl_path / file
111+
out = os.path.join(dl_path, file)
108112
print("Downloading {} to {}".format(file, out))
109113
urlretrieve(url, out)
110114

0 commit comments

Comments
 (0)