From c1da3ece069943cc0cceb7691dd63ab36a7f115d Mon Sep 17 00:00:00 2001 From: dmvict Date: Wed, 23 Aug 2023 14:27:46 +0300 Subject: [PATCH 1/2] feat: Extend workflow `publish`, allow to save nightly releases in format `nightly-yyyy-mm-dd` --- .github/workflows/publish.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e8b80dfbb9d..b7ceaf16f5b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -114,7 +114,7 @@ jobs: with: path: ${{ env.CACHED_PATHS }} key: ${{ steps.cache.outputs.cache-primary-key }} - + - name: Package artifacts run: | mkdir dist @@ -137,6 +137,11 @@ jobs: yarn install yarn test + - name: Get formatted date + id: date + if: ${{ inputs.publish || github.event_name == 'schedule' }} + run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT + - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish || github.event_name == 'schedule' }} @@ -146,7 +151,7 @@ jobs: file: ./nargo-${{ matrix.target }}.tar.gz asset_name: nargo-${{ matrix.target }}.tar.gz overwrite: true - tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + tag: ${{ inputs.tag || format('{0}-{1}', 'nightly', steps.date.outputs.date) }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) build-linux: needs: [build-barretenberg] @@ -229,6 +234,11 @@ jobs: yarn install yarn test + - name: Get formatted date + id: date + if: ${{ inputs.publish || github.event_name == 'schedule' }} + run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT + - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish || github.event_name == 'schedule' }} @@ -238,7 +248,7 @@ jobs: file: ./nargo-${{ matrix.target }}.tar.gz asset_name: nargo-${{ matrix.target }}.tar.gz overwrite: true - tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + tag: ${{ inputs.tag || format('{0}-{1}', 'nightly', steps.date.outputs.date) }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) build-windows: needs: [build-barretenberg] @@ -313,6 +323,11 @@ jobs: yarn install yarn test + - name: Get formatted date + id: date + if: ${{ inputs.publish || github.event_name == 'schedule' }} + run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT + - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish || github.event_name == 'schedule' }} @@ -322,4 +337,4 @@ jobs: file: ./nargo-${{ matrix.target }}.zip asset_name: nargo-${{ matrix.target }}.zip overwrite: true - tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + tag: ${{ inputs.tag || format('{0}-{1}', 'nightly', steps.date.outputs.date) }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) From e9e90c4a30b248a34eb1c62ceef2acd4afc18182 Mon Sep 17 00:00:00 2001 From: dmvict Date: Thu, 24 Aug 2023 11:48:34 +0300 Subject: [PATCH 2/2] fix: Update realization of saving artifacts, keep original logic, extend only date based part --- .github/workflows/publish.yml | 65 ++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b7ceaf16f5b..048d80a23c7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -137,11 +137,6 @@ jobs: yarn install yarn test - - name: Get formatted date - id: date - if: ${{ inputs.publish || github.event_name == 'schedule' }} - run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish || github.event_name == 'schedule' }} @@ -151,7 +146,23 @@ jobs: file: ./nargo-${{ matrix.target }}.tar.gz asset_name: nargo-${{ matrix.target }}.tar.gz overwrite: true - tag: ${{ inputs.tag || format('{0}-{1}', 'nightly', steps.date.outputs.date) }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + + - name: Get formatted date + id: date + if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }} + run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT + + - name: Upload binaries to nightly release with date tag + uses: svenstaro/upload-release-action@v2 + if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }} + with: + repo_name: noir-lang/noir + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./nargo-${{ matrix.target }}.zip + asset_name: nargo-${{ matrix.target }}.zip + overwrite: true + tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }} build-linux: needs: [build-barretenberg] @@ -234,11 +245,6 @@ jobs: yarn install yarn test - - name: Get formatted date - id: date - if: ${{ inputs.publish || github.event_name == 'schedule' }} - run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish || github.event_name == 'schedule' }} @@ -248,7 +254,23 @@ jobs: file: ./nargo-${{ matrix.target }}.tar.gz asset_name: nargo-${{ matrix.target }}.tar.gz overwrite: true - tag: ${{ inputs.tag || format('{0}-{1}', 'nightly', steps.date.outputs.date) }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + + - name: Get formatted date + id: date + if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }} + run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT + + - name: Upload binaries to nightly release with date tag + uses: svenstaro/upload-release-action@v2 + if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }} + with: + repo_name: noir-lang/noir + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./nargo-${{ matrix.target }}.zip + asset_name: nargo-${{ matrix.target }}.zip + overwrite: true + tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }} build-windows: needs: [build-barretenberg] @@ -323,18 +345,29 @@ jobs: yarn install yarn test + - name: Upload binaries to release tag + uses: svenstaro/upload-release-action@v2 + if: ${{ inputs.publish || github.event_name == 'schedule' }} + with: + repo_name: noir-lang/noir + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./nargo-${{ matrix.target }}.zip + asset_name: nargo-${{ matrix.target }}.zip + overwrite: true + tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + - name: Get formatted date id: date - if: ${{ inputs.publish || github.event_name == 'schedule' }} + if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }} run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Upload binaries to release tag + - name: Upload binaries to nightly release with date tag uses: svenstaro/upload-release-action@v2 - if: ${{ inputs.publish || github.event_name == 'schedule' }} + if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }} with: repo_name: noir-lang/noir repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./nargo-${{ matrix.target }}.zip asset_name: nargo-${{ matrix.target }}.zip overwrite: true - tag: ${{ inputs.tag || format('{0}-{1}', 'nightly', steps.date.outputs.date) }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }}