diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e61361d..f02236d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -5,8 +5,6 @@ on: push: branches: - main - paths-ignore: - - "Artifacts.toml" # Impending package release. Will trigger via `tags` tags: ["*"] concurrency: # Skip intermediate builds: on all builds except on the "main" branch. @@ -16,6 +14,7 @@ concurrency: jobs: unpublished: name: Artifact Check + if: ${{ github.ref_type != 'tag' }} # Always try using published artifacts for tags runs-on: ubuntu-latest outputs: key: ${{ steps.key.outputs.key }} @@ -80,7 +79,7 @@ jobs: # A valid Artifacts.toml file is required: Pkg.jl issue #2662 mv Artifacts.toml NewArtifacts.toml - git checkout origin/${{ github.base_ref }} -- Artifacts.toml + git checkout ${{ github.ref != 'refs/heads/main' && 'origin/main' || 'origin/main^' }} -- Artifacts.toml artifact_dir="$HOME/.julia/artifacts/${{ needs.unpublished.outputs.content_hash }}" mkdir -p "$artifact_dir" diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index d335066..34f8d14 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -6,6 +6,7 @@ on: - main paths: - "Artifacts.toml" + workflow_dispatch: {} jobs: publish: name: Publish @@ -29,11 +30,12 @@ jobs: println(io, "tarball_filename=$tarball_filename") println(io, "tag=v$(project.version)") end - - uses: dawidd6/action-download-artifact@v3 + - uses: dawidd6/action-download-artifact@v6 id: action-artifact with: workflow: Update.yaml name: ${{ steps.details.outputs.key }} + check_artifacts: true # Check more than just the latest "Update" workflow # As `ncipollo/release-action`'s `artifactErrorsFailBuild` input will still cause a release # to be created we'll perform this check to fail earlier. - name: Validate artifact retrieved @@ -49,3 +51,4 @@ jobs: body: ${{ steps.build_changelog.outputs.changelog }} artifacts: ${{ steps.details.outputs.tarball_filename }} artifactErrorsFailBuild: true + token: ${{ secrets.TZJDATA_UPDATE_TOKEN }} # Use PAT to trigger workflows on tag creation diff --git a/.github/workflows/Update.yaml b/.github/workflows/Update.yaml index 726c4f0..199e343 100644 --- a/.github/workflows/Update.yaml +++ b/.github/workflows/Update.yaml @@ -66,6 +66,11 @@ jobs: with: name: ${{ steps.build.outputs.key }} path: ${{ steps.build.outputs.tarball_path }} + # We need to introduce a slight delay after we upload the artifact to ensure the CI + # checks run for the PR can locate the artifact. + - name: Delay PR creation + if: ${{ steps.build.outputs.updated == 'true' }} + run: sleep 15 - name: Create Pull Request uses: peter-evans/create-pull-request@v5 if: ${{ steps.build.outputs.updated == 'true' }}