Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address CI release issues #30

Merged
merged 9 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 }}
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- "Artifacts.toml"
workflow_dispatch: {}
jobs:
publish:
name: Publish
Expand All @@ -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
Expand All @@ -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
5 changes: 5 additions & 0 deletions .github/workflows/Update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
Loading