diff --git a/.github/workflows/actions/prevent-rerun/action.yml b/.github/workflows/actions/prevent-rerun/action.yml new file mode 100644 index 00000000000..b0e1a3b58bd --- /dev/null +++ b/.github/workflows/actions/prevent-rerun/action.yml @@ -0,0 +1,11 @@ +name: Prevent Workflow Re-run +description: Fails if the workflow is re-run (github.run_attempt > 1) +runs: + using: "composite" + steps: + - name: Prevent any re-run + if: ${{ github.run_attempt > 1 }} + run: | + echo "::error::Re-running jobs is not permitted. Please trigger a new build manually at https://github.com/quarto-dev/quarto-cli/actions/workflows/create-release.yml (click 'Run workflow'), or use the GitHub CLI: 'gh workflow run create-release.yml'" + exit 1 + shell: bash diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d1fe033151d..e35e8f271b4 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -28,6 +28,7 @@ jobs: tag_name: v${{ steps.read-version.outputs.version_full }} version_commit: ${{ steps.version_commit.outputs.commit_long_sha }} pushed: ${{ steps.version_commit.outputs.pushed }} + tagged: ${{ steps.version_commit.outputs.tagged }} tag_pushed: ${{ steps.version_commit.outputs.tag_pushed }} if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'quarto-dev/quarto-cli') steps: @@ -35,6 +36,9 @@ jobs: with: fetch-depth: 0 + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + # we _also_ need npm, specifically for webui/preview - uses: actions/setup-node@v4 with: @@ -99,6 +103,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Make Tarball run: | tar --owner=root --group=root -zcvf quarto-${{needs.configure.outputs.version}}.tar.gz * @@ -117,6 +124,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Configure run: | ./configure.sh @@ -150,6 +160,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Configure run: | ./configure.sh @@ -183,6 +196,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Configure run: | ./configure.sh @@ -227,6 +243,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Configure run: | ./configure.sh @@ -257,6 +276,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Configure run: | ./configure.sh @@ -283,6 +305,15 @@ jobs: runs-on: ubuntu-latest needs: [configure, make-tarball] steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.configure.outputs.version_commit }} + sparse-checkout: | + .github + + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - uses: actions/download-artifact@v4 with: name: Deb Zip @@ -303,15 +334,17 @@ jobs: needs: [configure] steps: - - name: Configure Rust Tools - run: | - rustup.exe toolchain install 1.63.0 --component rustfmt --component clippy --no-self-update - rustup.exe default 1.63.0 - - uses: actions/checkout@v4 with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + + - name: Configure Rust Tools + run: | + rustup.exe toolchain install 1.63.0 --component rustfmt --component clippy --no-self-update + rustup.exe default 1.63.0 - name: Configure run: | .\configure.cmd @@ -383,6 +416,15 @@ jobs: runs-on: windows-latest needs: [configure, make-installer-win] steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.configure.outputs.version_commit }} + sparse-checkout: | + .github + + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - uses: actions/download-artifact@v4 with: name: Windows Zip @@ -403,6 +445,9 @@ jobs: with: ref: ${{ needs.configure.outputs.version_commit }} + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Configure run: | ./configure.sh @@ -464,6 +509,15 @@ jobs: runs-on: macos-latest needs: [configure, make-installer-mac] steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.configure.outputs.version_commit }} + sparse-checkout: | + .github + + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - uses: actions/download-artifact@v4 with: name: Mac Zip @@ -499,6 +553,16 @@ jobs: ] steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.configure.outputs.version_commit }} + path: quarto-cli + sparse-checkout: | + .github + + - name: Prevent Re-run + uses: ./quarto-cli/.github/workflows/actions/prevent-rerun + - name: Download Artifacts uses: actions/download-artifact@v4 @@ -601,6 +665,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Revert commit of version.txt if: ${{ needs.configure.outputs.pushed }} run: | @@ -614,7 +681,7 @@ jobs: git push origin $GITHUB_REF_NAME - name: Deleted created tag - if: ${{ needs.configure.outputs.tag_pushed }} + if: ${{ needs.configure.outputs.tagged && needs.configure.outputs.tag_pushed }} run: | git push --delete origin ${{ needs.configure.outputs.tag_name }} @@ -623,10 +690,18 @@ jobs: runs-on: ubuntu-latest needs: [configure, publish-release] steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + .github + + - name: Prevent Re-run + uses: ./.github/workflows/actions/prevent-rerun + - name: Download Artifacts uses: actions/download-artifact@v4 - - uses: quarto-dev/quarto-cli/.github/actions/docker@main + - uses: ./.github/actions/docker with: source: ./Deb Installer/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb version: ${{needs.configure.outputs.version}}