diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0b72dc8e..7474084c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,6 +9,11 @@ on: description: 'Tag to use for the build. Example: v1.0.0. *Null = master' required: false default: '' + latest: + description: 'Tag as latest ?' + type: boolean + required: false + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -67,6 +72,9 @@ jobs: wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.2/protoc-3.20.2-linux-x86_64.zip unzip protoc-3.20.2-linux-x86_64.zip -d /usr/local rm protoc-3.20.2-linux-x86_64.zip + wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip + unzip awscli-exe-linux-x86_64.zip + ./aws/install - name: Checkout `gear-tech/gear` uses: actions/checkout@v3 @@ -144,6 +152,25 @@ jobs: if-no-files-found: ignore path: ${{ env.ARTIFACT_NAME }} + - name: Update latest symlink for release artifacts (Linux/macOS) + if: > + github.event.inputs.release_version != '' && + github.event.inputs.latest == 'true' && + runner.os != 'Windows' + run: | + latest_artifact=$(aws s3api list-objects --bucket ${{ env.AWS_BUCKET }} --query "reverse(sort_by(Contents, &LastModified))[?contains(Key, 'gear-${{ github.event.inputs.release_version }}-${{ matrix.target }}')].[Key]" --output text) + aws s3api put-object --bucket ${{ env.AWS_BUCKET }} --key gear-latest-${{ matrix.target }}.${{ matrix.file_ext }} --website-redirect-location /$latest_artifact + + - name: Update latest symlink for release artifacts (Windows) + if: > + github.event.inputs.release_version != '' && + github.event.inputs.latest == 'true' && + runner.os == 'Windows' + run: | + $latest_artifact = aws s3api list-objects --bucket ${{ env.AWS_BUCKET }} --query "reverse(sort_by(Contents, &LastModified))[?contains(Key, 'gear-${{ github.event.inputs.release_version }}-${{ matrix.target }}')].[Key]" --output text + aws s3api put-object --bucket ${{ env.AWS_BUCKET }} --key "gear-latest-${{ matrix.target }}.${{ matrix.file_ext }}" --website-redirect-location "/$latest_artifact" + shell: pwsh + publish: name: Publish artifacts needs: build @@ -190,7 +217,7 @@ jobs:

Gear Builds

-

Nightly Builds - $(date -u +'%d.%m.%Y %H:%M:%S UTC')

+

Nightly Builds

" >> src/index.html @@ -213,7 +241,8 @@ jobs: filename=$(basename "$artifact") filesize_bytes=$(aws s3api head-object --bucket ${{ env.AWS_BUCKET }} --key "$artifact" --region ${{ env.AWS_REGION }} --query 'ContentLength' --output text) filesize_mb=$(echo "$filesize_bytes / 1024 / 1024" | bc -l | xargs printf "%.2f") - echo "
  • $filename ($filesize_mb MB)
  • " + last_modified=$(aws s3api head-object --bucket ${{ env.AWS_BUCKET }} --key "$artifact" --region ${{ env.AWS_REGION }} --query 'LastModified' --output text | xargs -I {} date -u -d {} "+%d.%m.%Y %H:%M:%S UTC") + echo "
  • $filename ($filesize_mb MB, $last_modified)
  • " done >> src/index.html echo " " diff --git a/src/static/styles.css b/src/static/styles.css index 07321477..60f9b688 100644 --- a/src/static/styles.css +++ b/src/static/styles.css @@ -11,7 +11,7 @@ body { padding-bottom: 12px; margin: 0 auto 24px auto; width: 100%; - max-width: 480px; + max-width: 800px; margin-bottom: 8px; } .footer { @@ -24,7 +24,7 @@ body { flex-direction: column; align-items: center; width: 100%; - max-width: 480px; + max-width: 800px; margin: 0 auto; padding: 16px 0; }