diff --git a/.github/workflows/ci-reusable.yml b/.github/workflows/ci-reusable.yml index 234f574a..bb74b9a2 100644 --- a/.github/workflows/ci-reusable.yml +++ b/.github/workflows/ci-reusable.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f154383..d4ba1bca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/')