mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-02 05:23:09 +00:00
ci: release master builds and upload them to the cloud (#1298)
This commit is contained in:
parent
7eb2fb12cc
commit
6cf99e255c
2
.github/workflows/ci-reusable.yml
vendored
2
.github/workflows/ci-reusable.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
|
||||
name: ${{ matrix.os }}-${{ matrix.tests }}-${{ matrix.cpu }}-${{ matrix.nim_version }}-${{ matrix.job_number }}
|
||||
runs-on: ${{ matrix.builder }}
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
||||
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@ -4,6 +4,8 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
@ -170,6 +172,33 @@ jobs:
|
||||
path: /tmp/release/
|
||||
retention-days: 30
|
||||
|
||||
- name: Release - Upload to the cloud
|
||||
env:
|
||||
s3_endpoint: ${{ secrets.S3_ENDPOINT }}
|
||||
s3_bucket: ${{ secrets.S3_BUCKET }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
||||
run: |
|
||||
# Variables
|
||||
branch="${GITHUB_REF_NAME/\//-}"
|
||||
folder="/tmp/release"
|
||||
|
||||
# Tagged releases
|
||||
if [[ "${{ github.ref }}" == *"refs/tags/"* ]]; then
|
||||
aws s3 cp --recursive "${folder}" s3://${{ env.s3_bucket }}/releases/${branch} --endpoint-url ${{ env.s3_endpoint }}
|
||||
echo "${branch}" > "${folder}"/latest
|
||||
aws s3 cp "${folder}"/latest s3://${{ env.s3_bucket }}/releases/latest --endpoint-url ${{ env.s3_endpoint }}
|
||||
|
||||
# master branch
|
||||
elif [[ "${branch}" == "${{ github.event.repository.default_branch }}" ]]; then
|
||||
aws s3 cp --recursive "${folder}" s3://${{ env.s3_bucket }}/${branch} --endpoint-url ${{ env.s3_endpoint }}
|
||||
|
||||
# Custom branch
|
||||
else
|
||||
aws s3 cp --recursive "${folder}" s3://${{ env.s3_bucket }}/branches/${branch} --endpoint-url ${{ env.s3_endpoint }}
|
||||
fi
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user