From 6ab1c1b6784d2edcb6cd747ed8d785a0f74b872a Mon Sep 17 00:00:00 2001 From: maciektr Date: Mon, 30 Oct 2023 13:22:40 +0100 Subject: [PATCH] WIP: dry-run --- .github/workflows/nightly.yml | 156 +++++++++++++++++----------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fe1090f72..98899f801 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -86,70 +86,70 @@ jobs: scarb-tag: v${{ needs.prepare.outputs.nightly_version }} ref: ${{ needs.prepare.outputs.nightly_branch }} - upload: - runs-on: ubuntu-latest - needs: [ prepare, release ] - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.prepare.outputs.nightly_branch }} - - - name: Create source code archives - run: | - git archive "--prefix=scarb-${{ needs.prepare.outputs.nightly_tag }}/" -o "scarb-${{ needs.prepare.outputs.nightly_tag }}.zip" HEAD - git archive "--prefix=scarb-${{ needs.prepare.outputs.nightly_tag }}/" -o "scarb-${{ needs.prepare.outputs.nightly_tag }}.tar.gz" HEAD - - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts-dl - - - name: Unpack artifacts to staging directory - run: | - mkdir -p artifacts - mv artifacts-dl/build-*/scarb-* artifacts/ - mv artifacts-dl/checksums/* artifacts/ - ls -lh artifacts/ - - - name: Create GitHub release - run: | - gh release create \ - "${{ needs.prepare.outputs.nightly_tag }}" \ - --repo software-mansion/scarb-nightlies \ - --latest \ - --title "${{ needs.prepare.outputs.nightly_tag }}" \ - --notes-file NIGHTLY_RELEASE_NOTES.md - env: - GH_TOKEN: ${{ secrets.SCARB_NIGHTLIES_CONTENTS_WRITE }} - - - name: Upload release assets - run: | - for file in \ - ./artifacts/* \ - "scarb-${{ needs.prepare.outputs.nightly_tag }}.zip#Scarb source code (zip)" \ - "scarb-${{ needs.prepare.outputs.nightly_tag }}.tar.gz#Scarb source code (tar.gz)" - do - # If there isn't # in name, it means that it is a build artifact - # and we need to remove version tag from the name, so it can be - # easily accessed in asdf and Scarb installation scripts - # - # for example: - # scarb-v0.6.0+nightly-2023-08-09-aarch64-apple-darwin.tar.gz - # becomes - # scarb-nightly-2023-08-09-aarch64-apple-darwin.tar.gz - if ! [[ $(grep "#" <<< $file) ]]; then - label=$(echo $file | sed -E "s/v[^+]*\+//" | sed -E "s/.\/artifacts\///") - cp "$file" "$label" - file="$label" - fi - - gh release upload \ - "${{ needs.prepare.outputs.nightly_tag }}" \ - "$file" \ - --repo software-mansion/scarb-nightlies - done - env: - GH_TOKEN: ${{ secrets.SCARB_NIGHTLIES_CONTENTS_WRITE }} +# upload: +# runs-on: ubuntu-latest +# needs: [ prepare, release ] +# steps: +# - uses: actions/checkout@v4 +# with: +# ref: ${{ needs.prepare.outputs.nightly_branch }} +# +# - name: Create source code archives +# run: | +# git archive "--prefix=scarb-${{ needs.prepare.outputs.nightly_tag }}/" -o "scarb-${{ needs.prepare.outputs.nightly_tag }}.zip" HEAD +# git archive "--prefix=scarb-${{ needs.prepare.outputs.nightly_tag }}/" -o "scarb-${{ needs.prepare.outputs.nightly_tag }}.tar.gz" HEAD +# +# - name: Download artifacts +# uses: actions/download-artifact@v3 +# with: +# path: artifacts-dl +# +# - name: Unpack artifacts to staging directory +# run: | +# mkdir -p artifacts +# mv artifacts-dl/build-*/scarb-* artifacts/ +# mv artifacts-dl/checksums/* artifacts/ +# ls -lh artifacts/ +# +# - name: Create GitHub release +# run: | +# gh release create \ +# "${{ needs.prepare.outputs.nightly_tag }}" \ +# --repo software-mansion/scarb-nightlies \ +# --latest \ +# --title "${{ needs.prepare.outputs.nightly_tag }}" \ +# --notes-file NIGHTLY_RELEASE_NOTES.md +# env: +# GH_TOKEN: ${{ secrets.SCARB_NIGHTLIES_CONTENTS_WRITE }} +# +# - name: Upload release assets +# run: | +# for file in \ +# ./artifacts/* \ +# "scarb-${{ needs.prepare.outputs.nightly_tag }}.zip#Scarb source code (zip)" \ +# "scarb-${{ needs.prepare.outputs.nightly_tag }}.tar.gz#Scarb source code (tar.gz)" +# do +# # If there isn't # in name, it means that it is a build artifact +# # and we need to remove version tag from the name, so it can be +# # easily accessed in asdf and Scarb installation scripts +# # +# # for example: +# # scarb-v0.6.0+nightly-2023-08-09-aarch64-apple-darwin.tar.gz +# # becomes +# # scarb-nightly-2023-08-09-aarch64-apple-darwin.tar.gz +# if ! [[ $(grep "#" <<< $file) ]]; then +# label=$(echo $file | sed -E "s/v[^+]*\+//" | sed -E "s/.\/artifacts\///") +# cp "$file" "$label" +# file="$label" +# fi +# +# gh release upload \ +# "${{ needs.prepare.outputs.nightly_tag }}" \ +# "$file" \ +# --repo software-mansion/scarb-nightlies +# done +# env: +# GH_TOKEN: ${{ secrets.SCARB_NIGHTLIES_CONTENTS_WRITE }} cleanup: runs-on: ubuntu-latest @@ -161,17 +161,17 @@ jobs: run: | git push origin -d ${{ needs.prepare.outputs.nightly_branch }} - notify_failed: - runs-on: ubuntu-latest - if: always() && contains(needs.*.result, 'failure') - needs: [ cleanup, upload, release, check, prepare ] - steps: - - name: Notifying about Nightly fail! - uses: slackapi/slack-github-action@v1.24.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NIGHTLY_FAILURE_WEBHOOK_URL }} - with: - payload: | - { - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } +# notify_failed: +# runs-on: ubuntu-latest +# if: always() && contains(needs.*.result, 'failure') +# needs: [ cleanup, upload, release, check, prepare ] +# steps: +# - name: Notifying about Nightly fail! +# uses: slackapi/slack-github-action@v1.24.0 +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NIGHTLY_FAILURE_WEBHOOK_URL }} +# with: +# payload: | +# { +# "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" +# }