From fc9db615a7658499442bb831ec6fb0a15b9d951f Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Thu, 4 Jul 2024 14:29:07 +0100 Subject: [PATCH] ci: build artifacts workflow to accept a tag Running from the tag on the workflow itself doesn't necessarily work here because it will use an older process, which doesn't help if you want to build binaries that were not part of that old process. --- .github/workflows/build-release-artifacts.yml | 6 +++++- test.sh | 12 ------------ 2 files changed, 5 insertions(+), 13 deletions(-) delete mode 100755 test.sh diff --git a/.github/workflows/build-release-artifacts.yml b/.github/workflows/build-release-artifacts.yml index ba3039197a..5d6f61f5fd 100644 --- a/.github/workflows/build-release-artifacts.yml +++ b/.github/workflows/build-release-artifacts.yml @@ -8,6 +8,10 @@ on: type: string required: true default: main + tag: + description: The tag to build. + type: string + required: false # Copied from `release.yml` # During the build step, the env variable has to be manually sent to the containers for cross platform builds. @@ -43,7 +47,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.branch }} + ref: ${{ inputs.tag || inputs.branch }} - uses: dtolnay/rust-toolchain@stable # cargo-binstall will try and use pre-built binaries if they are available and also speeds up # installing `cross` diff --git a/test.sh b/test.sh deleted file mode 100755 index 3b5662f3c5..0000000000 --- a/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -BUCKET_NAME="your-bucket-name" -DESTINATION_PATH="s3://nat-detection/nat-detection-0.1.0-aarch64-unknown-linux-musl.zip" -LOCAL_FILE_PATH="path/to/local/file" - -if aws s3 ls "$DESTINATION_PATH" > /dev/null 2>&1; then - echo "Error: Destination file already exists in the bucket." - exit 1 -else - echo "will upload" -fi