From c589839d6bed98c696c6cc4c1ff67008cb9d9b77 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jan 2024 23:49:39 -0600 Subject: [PATCH 01/63] First pass on build workflow --- .github/workflows/Build.yaml | 44 ++++++++++++++++++++++++ gen/make.jl | 66 +++++++++++++++++++++++++++--------- 2 files changed, 94 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/Build.yaml diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml new file mode 100644 index 0000000..5fa0959 --- /dev/null +++ b/.github/workflows/Build.yaml @@ -0,0 +1,44 @@ +--- +name: Build +on: + workflow_dispatch: + inputs: + tzdata_version: + required: true + type: string +jobs: + build: + runs-on: ubuntu-latest + env: + JULIA_PROJECT: gen + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: "1" + - uses: julia-actions/cache@v1 + - name: Instantiate + shell: julia --color=yes {0} + run: | + using Pkg + Pkg.instantiate() + - name: Build tzdata + id: build + shell: julia --color=yes {0} + run: | + include("make.jl") + (; tarball_path) = update_tzdata() + @show tarball_path + open(ENV["GITHUB_OUTPUT"], "a") do io + println(io, "tarball_path=$tarball_path") + println(io, "tarball_name=$(basename(tarball_path))") + end + - name: Debug + run: | + echo "${{ steps.build.outputs.tarball_path }}" + git diff + - uses: actions/upload-artifact@v4 + id: action-artifact + with: + name: ${{ steps.build.outputs.tarball_name }} + path: ${{ steps.build.outputs.tarball_path }} diff --git a/gen/make.jl b/gen/make.jl index 6993dce..41430e0 100644 --- a/gen/make.jl +++ b/gen/make.jl @@ -109,19 +109,7 @@ function upload_to_github_release(owner, repo_name, commit, tag, path; token=ENV run(cmd) end -# TODO: Re-running always bumps version -if abspath(PROGRAM_FILE) == @__FILE__ - tzdata_version = tzdata_latest_version() - tarball_name = "tzjfile-v1-tzdata$(tzdata_version).tar.gz" - - # Build tzjfile artifact content - # TZData.cleanup(tzdata_version, _scratch_dir()) - compiled_dir = TZData.build(tzdata_version, _scratch_dir()) - - @info "Creating tarball $tarball_name" - tarball_path = joinpath(tempdir(), tarball_name) - create_tarball(compiled_dir, tarball_path) - +function update_tzdata() repo_path = joinpath(@__DIR__, "..") pkg_url = remote_url(repo_path) @@ -129,7 +117,28 @@ if abspath(PROGRAM_FILE) == @__FILE__ project_toml = joinpath(repo_path, "Project.toml") project = read_project(project_toml) old_version = project.version - new_version = Base.nextpatch(project.version) + old_tzdata_version = only(old_version.build) + + # Always fetch the current list of tzdata versions (ignoring any caching). + tzdata_versions = TZData.tzdata_versions() + i = findfirst(==(old_tzdata_version), tzdata_versions) + if i == length(tzdata_versions) + new_tzdata_version = tzdata_versions[i] + new_version = Base.nextpatch(old_version) + else + new_tzdata_version = tzdata_versions[i + 1] + new_version = Base.nextminor(old_version) + end + + tarball_name = "tzjfile-v1-tzdata$(new_tzdata_version).tar.gz" + + # Build tzjfile artifact content + # TZData.cleanup(new_tzdata_version, _scratch_dir()) + compiled_dir = TZData.build(new_tzdata_version, _scratch_dir()) + + @info "Creating tarball $tarball_name" + tarball_path = joinpath(tempdir(), tarball_name) + create_tarball(compiled_dir, tarball_path) # Include tzdata version in build number new_version = VersionNumber( @@ -137,7 +146,7 @@ if abspath(PROGRAM_FILE) == @__FILE__ new_version.minor, new_version.patch, (), - (tzdata_version,), + (new_tzdata_version,), ) @info "Bumping package $(project.name) from $old_version -> $new_version" @@ -156,10 +165,35 @@ if abspath(PROGRAM_FILE) == @__FILE__ force=true, ) + return (; + repo_path, + project_toml, + artifacts_toml, + artifact_url, + tarball_path, + old_tzdata_version, + new_tzdata_version, + old_version, + new_version, + ) +end + +# TODO: Re-running always bumps version +if abspath(PROGRAM_FILE) == @__FILE__ + (; + repo_path, + new_tzdata_version, + new_version, + project_toml, + artifacts_toml, + artifact_url, + tarball_path, + ) = update_tzdata() + # TODO: Ensure no other files are staged before committing @info "Committing and pushing Project.toml and Artifacts.toml" branch = "main" - message = "Set artifact to tzdata$(tzdata_version) and project to $(new_version)" + message = "Set artifact to tzdata$(new_tzdata_version) and project to $(new_version)" # TODO: ghr and LibGit2 use different credential setups. Double check # what BB does here. From b1b2c664d587b454936f9855c4fadb437e9f6708 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jan 2024 23:51:05 -0600 Subject: [PATCH 02/63] Add pull_request event for now --- .github/workflows/Build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 5fa0959..17563b2 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -1,6 +1,7 @@ --- name: Build on: + pull_request: workflow_dispatch: inputs: tzdata_version: From 47ac52c019385c064fc127a7c552e556f4f70483 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Thu, 25 Jan 2024 23:55:00 -0600 Subject: [PATCH 03/63] Fix include path --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 17563b2..634bf6f 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -27,7 +27,7 @@ jobs: id: build shell: julia --color=yes {0} run: | - include("make.jl") + include("gen/make.jl") (; tarball_path) = update_tzdata() @show tarball_path open(ENV["GITHUB_OUTPUT"], "a") do io From 492bca1ad660e411dfa87662706ac0dca6a19eea Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Fri, 26 Jan 2024 00:03:08 -0600 Subject: [PATCH 04/63] Julia shell has quirks --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 634bf6f..61c6f0a 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -27,7 +27,7 @@ jobs: id: build shell: julia --color=yes {0} run: | - include("gen/make.jl") + include(joinpath(pwd(), "gen", "make.jl")) (; tarball_path) = update_tzdata() @show tarball_path open(ENV["GITHUB_OUTPUT"], "a") do io From 1c35938a18776f7766ed04e25e7db7017074882c Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sat, 27 Jan 2024 23:52:02 -0600 Subject: [PATCH 05/63] Attempt download artifact in CI workflow --- .github/workflows/Build.yaml | 6 +++--- .github/workflows/CI.yml | 32 ++++++++++++++++++++++++++++++++ gen/make.jl | 4 +++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 61c6f0a..3689cc6 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -28,11 +28,11 @@ jobs: shell: julia --color=yes {0} run: | include(joinpath(pwd(), "gen", "make.jl")) - (; tarball_path) = update_tzdata() + (; tarball_path, tarball_sha256) = update_tzdata() @show tarball_path open(ENV["GITHUB_OUTPUT"], "a") do io + println(io, "key=$(basename(tarball_path))-$(tarball_sha256)") println(io, "tarball_path=$tarball_path") - println(io, "tarball_name=$(basename(tarball_path))") end - name: Debug run: | @@ -41,5 +41,5 @@ jobs: - uses: actions/upload-artifact@v4 id: action-artifact with: - name: ${{ steps.build.outputs.tarball_name }} + name: ${{ steps.build.outputs.key }} path: ${{ steps.build.outputs.tarball_path }} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 54ea2d2..815537c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,8 +11,33 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.run_number || 0 }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: + prerelease: + runs-on: ubuntu-latest + outputs: + key: ${{ steps.key.outputs.key }} + steps: + - uses: dorny/paths-filter@v3 + id: changed + with: + filters: | + artifact_toml: + - Artifact.toml + - uses: actions/checkout@v4 + if: ${{ steps.changed.output.artifact_toml == 'true' }} + - name: Check for unpublished artifact + if: ${{ steps.changed.output.artifact_toml == 'true' }} + id: key + shell: julia --color=yes {0} + run: | + include(joinpath(pwd(), "gen", "make.jl")) + key = gh_artifact_key() + open(ENV["GITHUB_OUTPUT"], "a") do io + println(io, "key=$key") + end + test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + needs: prerelease runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.version == 'nightly' }} strategy: @@ -28,6 +53,13 @@ jobs: - x64 steps: - uses: actions/checkout@v3 + - uses: dawidd6/action-download-artifact@v3 + if: ${{ needs.prerelease.outputs.key }} + id: action-artifact + with: + workflow: Build.yaml + name: ${{ steps.check.output.key }} + - run: ls -la - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} diff --git a/gen/make.jl b/gen/make.jl index 41430e0..d9bcd94 100644 --- a/gen/make.jl +++ b/gen/make.jl @@ -157,11 +157,12 @@ function update_tzdata() artifact_url = "$(pkg_url)/releases/download/$(tag)/$(basename(tarball_path))" artifacts_toml = joinpath(repo_path, "Artifacts.toml") + tarball_sha256 = sha256sum(tarball_path) bind_artifact!( artifacts_toml, "tzjdata", tree_hash_sha1(tarball_path); - download_info=[(artifact_url, sha256sum(tarball_path))], + download_info=[(artifact_url, tarball_sha256)], force=true, ) @@ -171,6 +172,7 @@ function update_tzdata() artifacts_toml, artifact_url, tarball_path, + tarball_sha256, old_tzdata_version, new_tzdata_version, old_version, From 19f6c729994a7091df39b399caea208f4bdc13b0 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sat, 27 Jan 2024 23:55:53 -0600 Subject: [PATCH 06/63] Commit auto-generated Artifact.toml --- Artifacts.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 0ac9578..de0a78e 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [tzjdata] -git-tree-sha1 = "52e48e96c4df04eeebc6ece0d9f1c3b545f0544c" +git-tree-sha1 = "b071cffdb310f5d3ca640c09cfa3dc3f23d450ad" [[tzjdata.download]] - sha256 = "50cd6c70dfb582336b4223adb3fe76aca6c6a9a5982c3111001e2091fb947b66" - url = "https://github.com/JuliaTime/TZJData.jl/releases/download/v1.0.0+2023c/tzjfile-v1-tzdata2023c.tar.gz" + sha256 = "ff06bf7c19783925eff4430f1571c5cf81bf9232240dd2ee98d8a66987612f24" + url = "https://github.com/JuliaTime/TZJData.jl/releases/download/v1.1.0+2023d/tzjfile-v1-tzdata2023d.tar.gz" \ No newline at end of file From e2960db83b0c8fafccd9a4b942c027abd5e75e4f Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sat, 27 Jan 2024 23:57:31 -0600 Subject: [PATCH 07/63] Iterating --- .github/workflows/CI.yml | 2 +- gen/make.jl | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 815537c..e03006e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,7 @@ jobs: with: filters: | artifact_toml: - - Artifact.toml + - Artifacts.toml - uses: actions/checkout@v4 if: ${{ steps.changed.output.artifact_toml == 'true' }} - name: Check for unpublished artifact diff --git a/gen/make.jl b/gen/make.jl index d9bcd94..09180e3 100644 --- a/gen/make.jl +++ b/gen/make.jl @@ -17,6 +17,8 @@ const GH_RELEASE_ASSET_PATH_REGEX = r""" (?[^/]+)/(?[^/]+)$ """x +const PKG_ROOT = joinpath(@__DIR__(), "..") + function create_tarball(dir, tarball) return open(GzipCompressorStream, tarball, "w") do tar Tar.create(dir, tar) @@ -180,6 +182,16 @@ function update_tzdata() ) end +function gh_artifact_key(artifact_toml=joinpath(PKG_ROOT, "Artifacts.toml")) + toml = TOML.parsefile(artifact_toml) + tarball_artifact = only(toml["tzjdata"]["download"]) + tarball_filename = basename(tarball_artifact["url"]) + tarball_sha256 = tarball_artifact["sha256"] + + key = "$(tarball_filename)-$(tarball_sha256)" + return key +end + # TODO: Re-running always bumps version if abspath(PROGRAM_FILE) == @__FILE__ (; From ae264843e375c2c404b69ad7a23505cfee4e3ee4 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sat, 27 Jan 2024 23:59:28 -0600 Subject: [PATCH 08/63] Iterating --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e03006e..12e958a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,15 +17,15 @@ jobs: key: ${{ steps.key.outputs.key }} steps: - uses: dorny/paths-filter@v3 - id: changed + id: filter with: filters: | - artifact_toml: + modified_artifacts_toml: - Artifacts.toml - uses: actions/checkout@v4 - if: ${{ steps.changed.output.artifact_toml == 'true' }} + if: ${{ steps.filter.outputs.modified_artifacts_toml == 'true' }} - name: Check for unpublished artifact - if: ${{ steps.changed.output.artifact_toml == 'true' }} + if: ${{ steps.filter.outputs.modified_artifacts_toml == 'true' }} id: key shell: julia --color=yes {0} run: | From 45254b3ca871bc246e1f697ecad82f423ee2aa4c Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:01:59 -0600 Subject: [PATCH 09/63] Avoid requiring more packages --- .github/workflows/CI.yml | 2 +- gen/make.jl | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 12e958a..3c0c764 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: id: key shell: julia --color=yes {0} run: | - include(joinpath(pwd(), "gen", "make.jl")) + include(joinpath(pwd(), "gen", "artifacts.jl")) key = gh_artifact_key() open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$key") diff --git a/gen/make.jl b/gen/make.jl index 09180e3..d9bcd94 100644 --- a/gen/make.jl +++ b/gen/make.jl @@ -17,8 +17,6 @@ const GH_RELEASE_ASSET_PATH_REGEX = r""" (?[^/]+)/(?[^/]+)$ """x -const PKG_ROOT = joinpath(@__DIR__(), "..") - function create_tarball(dir, tarball) return open(GzipCompressorStream, tarball, "w") do tar Tar.create(dir, tar) @@ -182,16 +180,6 @@ function update_tzdata() ) end -function gh_artifact_key(artifact_toml=joinpath(PKG_ROOT, "Artifacts.toml")) - toml = TOML.parsefile(artifact_toml) - tarball_artifact = only(toml["tzjdata"]["download"]) - tarball_filename = basename(tarball_artifact["url"]) - tarball_sha256 = tarball_artifact["sha256"] - - key = "$(tarball_filename)-$(tarball_sha256)" - return key -end - # TODO: Re-running always bumps version if abspath(PROGRAM_FILE) == @__FILE__ (; From 43e0677755af6b29601bbfa689efdbb8a2fb286a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:02:56 -0600 Subject: [PATCH 10/63] fixup! Avoid requiring more packages --- gen/artifacts.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gen/artifacts.jl diff --git a/gen/artifacts.jl b/gen/artifacts.jl new file mode 100644 index 0000000..e546876 --- /dev/null +++ b/gen/artifacts.jl @@ -0,0 +1,13 @@ +using TOML: TOML + +const PKG_ROOT = joinpath(@__DIR__(), "..") + +function gh_artifact_key(artifact_toml=joinpath(PKG_ROOT, "Artifacts.toml")) + toml = TOML.parsefile(artifact_toml) + tarball_artifact = only(toml["tzjdata"]["download"]) + tarball_filename = basename(tarball_artifact["url"]) + tarball_sha256 = tarball_artifact["sha256"] + + key = "$(tarball_filename)-$(tarball_sha256)" + return key +end From e31b6902368c0f6c7915ba9411ecd7dc56c2c2c9 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:08:50 -0600 Subject: [PATCH 11/63] Basic overrides test --- .github/workflows/CI.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3c0c764..38594e5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -59,7 +59,15 @@ jobs: with: workflow: Build.yaml name: ${{ steps.check.output.key }} - - run: ls -la + - shell: julia --color=yes {0} + run: | + open(joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml", "w") do io + println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") + println(io, "tzjdata = "$(pwd)/${{ steps.prerelease.outputs.key }}") + end + - run: | + ls -la ${{ steps.prerelease.outputs.key }} + cat ~/.julia/artifacts/Overrides.toml - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From bf0cbd38f156f4868e8cd7dab89763600ceae276 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:11:01 -0600 Subject: [PATCH 12/63] fixup! Basic overrides test --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 38594e5..6e9cafe 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -58,15 +58,15 @@ jobs: id: action-artifact with: workflow: Build.yaml - name: ${{ steps.check.output.key }} + name: ${{ needs.prerelease.outputs.key }} - shell: julia --color=yes {0} run: | - open(joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml", "w") do io + open(joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml"), "w") do io println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") - println(io, "tzjdata = "$(pwd)/${{ steps.prerelease.outputs.key }}") + println(io, "tzjdata = "$(pwd)/${{ needs.prerelease.outputs.key }}") end - run: | - ls -la ${{ steps.prerelease.outputs.key }} + ls -la ${{ needs.prerelease.outputs.key }} cat ~/.julia/artifacts/Overrides.toml - uses: julia-actions/setup-julia@v1 with: From cf7ca39ec641d34702b3ad589554063697a01cb9 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:12:44 -0600 Subject: [PATCH 13/63] fixup! Basic overrides test --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6e9cafe..7479650 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,7 +63,7 @@ jobs: run: | open(joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml"), "w") do io println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") - println(io, "tzjdata = "$(pwd)/${{ needs.prerelease.outputs.key }}") + println(io, "tzjdata = \"$(pwd)/${{ needs.prerelease.outputs.key }}\"") end - run: | ls -la ${{ needs.prerelease.outputs.key }} From 2e43beb7021f06fb8a71a0b36e3d8982d9cf9613 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:14:19 -0600 Subject: [PATCH 14/63] fixup! Basic overrides test --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7479650..e43a60d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -61,7 +61,9 @@ jobs: name: ${{ needs.prerelease.outputs.key }} - shell: julia --color=yes {0} run: | - open(joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml"), "w") do io + artifacts_overrides_toml = joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml") + mkpath(dirname(artifacts_overrides_toml)) + open(artifacts_overrides_toml, "w") do io println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") println(io, "tzjdata = \"$(pwd)/${{ needs.prerelease.outputs.key }}\"") end From 185508a6c168b75df3b34c2093616440d8371777 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:15:34 -0600 Subject: [PATCH 15/63] Debugging --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e43a60d..c753659 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -68,8 +68,9 @@ jobs: println(io, "tzjdata = \"$(pwd)/${{ needs.prerelease.outputs.key }}\"") end - run: | - ls -la ${{ needs.prerelease.outputs.key }} + ls -la cat ~/.julia/artifacts/Overrides.toml + ls -la ${{ needs.prerelease.outputs.key }} - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From 05d4cb2af08daa9e0218ba14d9b8bc21ff4b2338 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:20:49 -0600 Subject: [PATCH 16/63] Iterating --- .github/workflows/CI.yml | 14 +++++++++++--- gen/artifacts.jl | 8 ++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c753659..7e14d06 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest outputs: key: ${{ steps.key.outputs.key }} + tarball_filename: ${{ steps.key.outputs.tarball_filename }} steps: - uses: dorny/paths-filter@v3 id: filter @@ -30,9 +31,10 @@ jobs: shell: julia --color=yes {0} run: | include(joinpath(pwd(), "gen", "artifacts.jl")) - key = gh_artifact_key() + (; key, tarball_filename) = gh_artifact() open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$key") + println(io, "tarball_filename=$tarball_filename") end test: @@ -59,18 +61,21 @@ jobs: with: workflow: Build.yaml name: ${{ needs.prerelease.outputs.key }} + - run: | + tar xvf ${{ needs.prerelease.outputs.tarball_filename }} + ls -la - shell: julia --color=yes {0} run: | artifacts_overrides_toml = joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml") mkpath(dirname(artifacts_overrides_toml)) open(artifacts_overrides_toml, "w") do io println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") - println(io, "tzjdata = \"$(pwd)/${{ needs.prerelease.outputs.key }}\"") + println(io, "tzjdata = \"$(pwd())/${{ needs.prerelease.outputs.tarball_filename }}\"") end - run: | ls -la cat ~/.julia/artifacts/Overrides.toml - ls -la ${{ needs.prerelease.outputs.key }} + ls -la ${{ needs.prerelease.outputs.tarball_filename }} - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -78,3 +83,6 @@ jobs: - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 + + +tzjfile-v1-tzdata2023d.tar.gz-ff06bf7c19783925eff4430f1571c5cf81bf9232240dd2ee98d8a66987612f24 \ No newline at end of file diff --git a/gen/artifacts.jl b/gen/artifacts.jl index e546876..14f5eee 100644 --- a/gen/artifacts.jl +++ b/gen/artifacts.jl @@ -2,12 +2,16 @@ using TOML: TOML const PKG_ROOT = joinpath(@__DIR__(), "..") -function gh_artifact_key(artifact_toml=joinpath(PKG_ROOT, "Artifacts.toml")) +function gh_artifact(artifact_toml=joinpath(PKG_ROOT, "Artifacts.toml")) toml = TOML.parsefile(artifact_toml) tarball_artifact = only(toml["tzjdata"]["download"]) tarball_filename = basename(tarball_artifact["url"]) tarball_sha256 = tarball_artifact["sha256"] key = "$(tarball_filename)-$(tarball_sha256)" - return key + return (; + tarball_filename, + tarball_sha256, + key, + ) end From 240ca1be8ecea76fd2120b9e033971eed89a594a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:21:39 -0600 Subject: [PATCH 17/63] Whoops --- .github/workflows/CI.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7e14d06..d0dc08f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -83,6 +83,3 @@ jobs: - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - - -tzjfile-v1-tzdata2023d.tar.gz-ff06bf7c19783925eff4430f1571c5cf81bf9232240dd2ee98d8a66987612f24 \ No newline at end of file From e73d9f5355be7a79ab7c9be9293de84fe7d40c6f Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:24:05 -0600 Subject: [PATCH 18/63] Should be it --- .github/workflows/CI.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d0dc08f..058afa3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -62,7 +62,8 @@ jobs: workflow: Build.yaml name: ${{ needs.prerelease.outputs.key }} - run: | - tar xvf ${{ needs.prerelease.outputs.tarball_filename }} + mkdir prerelease + tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease ls -la - shell: julia --color=yes {0} run: | @@ -70,12 +71,10 @@ jobs: mkpath(dirname(artifacts_overrides_toml)) open(artifacts_overrides_toml, "w") do io println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") - println(io, "tzjdata = \"$(pwd())/${{ needs.prerelease.outputs.tarball_filename }}\"") + println(io, "tzjdata = \"$(pwd())/prerelease\"") end - run: | - ls -la cat ~/.julia/artifacts/Overrides.toml - ls -la ${{ needs.prerelease.outputs.tarball_filename }} - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From e6799062a7bf45e15993861cca598b41e6eaf59f Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:28:08 -0600 Subject: [PATCH 19/63] Pkg work around --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 058afa3..3cb8e9e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -75,6 +75,7 @@ jobs: end - run: | cat ~/.julia/artifacts/Overrides.toml + rm Artifacts.toml # Work around Pkg.jl issue #2662 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From 73861cdc34c1d39a2b10d9aac4b1f5a8c4e5d8d4 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:36:30 -0600 Subject: [PATCH 20/63] Create minimal Artifacts.toml --- .github/workflows/CI.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3cb8e9e..33f7970 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -70,12 +70,26 @@ jobs: artifacts_overrides_toml = joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml") mkpath(dirname(artifacts_overrides_toml)) open(artifacts_overrides_toml, "w") do io - println(io, "[dc5dba14-91b3-4cab-a142-028a31da12f7]") - println(io, "tzjdata = \"$(pwd())/prerelease\"") + println( + io, + """ + [dc5dba14-91b3-4cab-a142-028a31da12f7]") + tzjdata = "$(pwd())/prerelease" + """ + ) + end + # Work around Pkg.jl issue #2662 + open("Artifacts.toml", "w") do io + println( + io, + """ + [tzjdata] + git-tree-sha1 = "b071cffdb310f5d3ca640c09cfa3dc3f23d450ad" + """ + ) end - run: | cat ~/.julia/artifacts/Overrides.toml - rm Artifacts.toml # Work around Pkg.jl issue #2662 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From 7b677593c7193f70ab116d5953743d2c74a8f5e2 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 00:39:27 -0600 Subject: [PATCH 21/63] fixup! Create minimal Artifacts.toml --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 33f7970..e9da840 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -73,7 +73,7 @@ jobs: println( io, """ - [dc5dba14-91b3-4cab-a142-028a31da12f7]") + [dc5dba14-91b3-4cab-a142-028a31da12f7] tzjdata = "$(pwd())/prerelease" """ ) @@ -89,7 +89,9 @@ jobs: ) end - run: | + set -x cat ~/.julia/artifacts/Overrides.toml + cat Artifacts.toml - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From 2b5026a7be757feca0473ed9e8e28d261faef1d1 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 22:43:00 -0600 Subject: [PATCH 22/63] Test empty artifact --- .github/workflows/CI.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9da840..b53a5d4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -83,8 +83,6 @@ jobs: println( io, """ - [tzjdata] - git-tree-sha1 = "b071cffdb310f5d3ca640c09cfa3dc3f23d450ad" """ ) end From 8d4136620142808db9b9b8510f5038bba1cda05d Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 22:45:46 -0600 Subject: [PATCH 23/63] Use valid Artifacts.toml file --- .github/workflows/CI.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b53a5d4..bbf0342 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,6 +64,8 @@ jobs: - run: | mkdir prerelease tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease + # A valid Artifacts.toml file is required: Pkg.jl issue #2662 + git checkout ${{ github.base_ref }} -- Artifacts.toml ls -la - shell: julia --color=yes {0} run: | @@ -78,14 +80,6 @@ jobs: """ ) end - # Work around Pkg.jl issue #2662 - open("Artifacts.toml", "w") do io - println( - io, - """ - """ - ) - end - run: | set -x cat ~/.julia/artifacts/Overrides.toml From 9354be906b27f496b8148e364d12622c234d6658 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 22:47:59 -0600 Subject: [PATCH 24/63] Debug --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bbf0342..e899e86 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -62,11 +62,11 @@ jobs: workflow: Build.yaml name: ${{ needs.prerelease.outputs.key }} - run: | - mkdir prerelease - tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease + set -x # A valid Artifacts.toml file is required: Pkg.jl issue #2662 git checkout ${{ github.base_ref }} -- Artifacts.toml - ls -la + mkdir prerelease + tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease - shell: julia --color=yes {0} run: | artifacts_overrides_toml = joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml") From b8af5f713f618396b91ed3c22ec43c533ee4a570 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 22:51:25 -0600 Subject: [PATCH 25/63] Max fetch-depth --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e899e86..87110b5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -55,6 +55,8 @@ jobs: - x64 steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Allows checkout of Artifacts.toml from base ref - uses: dawidd6/action-download-artifact@v3 if: ${{ needs.prerelease.outputs.key }} id: action-artifact From 77857a9449a9961a84eecad3428996ffb6ec6b19 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 22:52:54 -0600 Subject: [PATCH 26/63] Checkout from remote --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 87110b5..79f77fd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -66,7 +66,7 @@ jobs: - run: | set -x # A valid Artifacts.toml file is required: Pkg.jl issue #2662 - git checkout ${{ github.base_ref }} -- Artifacts.toml + git checkout origin/${{ github.base_ref }} -- Artifacts.toml mkdir prerelease tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease - shell: julia --color=yes {0} From 8ad4b46980d892e3383008be0eef587cacd4670d Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Sun, 28 Jan 2024 23:23:43 -0600 Subject: [PATCH 27/63] Use content hash --- .github/workflows/CI.yml | 29 ++++++++++++++--------------- gen/artifacts.jl | 2 ++ gen/make.jl | 3 ++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 79f77fd..981346c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,6 +16,7 @@ jobs: outputs: key: ${{ steps.key.outputs.key }} tarball_filename: ${{ steps.key.outputs.tarball_filename }} + content_hash: ${{ steps.key.outputs.content_hash }} steps: - uses: dorny/paths-filter@v3 id: filter @@ -31,10 +32,11 @@ jobs: shell: julia --color=yes {0} run: | include(joinpath(pwd(), "gen", "artifacts.jl")) - (; key, tarball_filename) = gh_artifact() + (; key, tarball_filename, content_hash) = gh_artifact() open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$key") println(io, "tarball_filename=$tarball_filename") + println(io, "content_hash=$content_hash") end test: @@ -63,25 +65,22 @@ jobs: with: workflow: Build.yaml name: ${{ needs.prerelease.outputs.key }} + - name: Clear cached Overrides.toml + if: ${{ !needs.prerelease.outputs.key }} + run: rm -f ~/.julia/artifacts/Overrides.toml - run: | set -x # A valid Artifacts.toml file is required: Pkg.jl issue #2662 + mv Artifacts.toml NewArtifacts.toml git checkout origin/${{ github.base_ref }} -- Artifacts.toml mkdir prerelease - tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease - - shell: julia --color=yes {0} - run: | - artifacts_overrides_toml = joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml") - mkpath(dirname(artifacts_overrides_toml)) - open(artifacts_overrides_toml, "w") do io - println( - io, - """ - [dc5dba14-91b3-4cab-a142-028a31da12f7] - tzjdata = "$(pwd())/prerelease" - """ - ) - end + tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C ~/.julia/artifacts/${{ needs.prerelease.outputs.content_hash }} + echo "TARBALL_PATH=${{ needs.prerelease.outputs.tarball_filename }}" | tee -a "$GITHUB_ENV" + + cat > ~/.julia/artifacts/Overrides.toml < Date: Sun, 28 Jan 2024 23:25:50 -0600 Subject: [PATCH 28/63] fixup! Use content hash --- .github/workflows/CI.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 981346c..2b356ed 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -73,9 +73,10 @@ 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 - mkdir prerelease - tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C ~/.julia/artifacts/${{ needs.prerelease.outputs.content_hash }} - echo "TARBALL_PATH=${{ needs.prerelease.outputs.tarball_filename }}" | tee -a "$GITHUB_ENV" + + artifact_path="$HOME/.julia/artifacts/${{ needs.prerelease.outputs.content_hash }}" + mkdir -p "$artifact_path" + tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C "$artifact_path" cat > ~/.julia/artifacts/Overrides.toml < Date: Sun, 28 Jan 2024 23:29:20 -0600 Subject: [PATCH 29/63] Go back to path --- .github/workflows/CI.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2b356ed..d402df7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -74,13 +74,18 @@ jobs: mv Artifacts.toml NewArtifacts.toml git checkout origin/${{ github.base_ref }} -- Artifacts.toml - artifact_path="$HOME/.julia/artifacts/${{ needs.prerelease.outputs.content_hash }}" - mkdir -p "$artifact_path" - tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C "$artifact_path" + artifact_dir="$HOME/.julia/artifacts/${{ needs.prerelease.outputs.content_hash }}" + mkdir -p "$artifact_dir" + tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C "$artifact_dir" + + # cat > ~/.julia/artifacts/Overrides.toml < ~/.julia/artifacts/Overrides.toml < Date: Mon, 29 Jan 2024 23:32:00 -0600 Subject: [PATCH 30/63] Unpublished artifact tests --- .github/workflows/CI.yml | 4 ++++ Project.toml | 10 +++++++++- test/runtests.jl | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d402df7..d5c96f6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -78,6 +78,7 @@ jobs: mkdir -p "$artifact_dir" tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C "$artifact_dir" + # Why doesn't this work? # cat > ~/.julia/artifacts/Overrides.toml <\d{2}\d{2}?[a-z])") + end + end + @testset "load compiled" begin cache = Dict{String,Tuple{TimeZone,Class}}() _reload_cache!(cache, TZJData.ARTIFACT_DIR) From 3e51a875951f369fbce51fa48ef6f3114c64bca0 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Mon, 29 Jan 2024 23:53:55 -0600 Subject: [PATCH 31/63] fixup! Unpublished artifact tests --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4ad9276..688d77f 100644 --- a/Project.toml +++ b/Project.toml @@ -8,7 +8,7 @@ Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] CodecZlib = "0.7" -SHA = "0.7" +SHA = "1.6" Tar = "1" TimeZones = "1" julia = "1.6" From 2536b28dfa2a5993ba80e6508bb4daac288e3355 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Mon, 29 Jan 2024 23:54:23 -0600 Subject: [PATCH 32/63] Release workflow --- .github/workflows/CI.yml | 19 ++++++++-------- .github/workflows/Release.yaml | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/Release.yaml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d5c96f6..f19db4e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.run_number || 0 }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - prerelease: + unpublished: + name: Check for unpublished artifact runs-on: ubuntu-latest outputs: key: ${{ steps.key.outputs.key }} @@ -41,7 +42,7 @@ jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - needs: prerelease + needs: unpublished runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.version == 'nightly' }} strategy: @@ -60,13 +61,13 @@ jobs: with: fetch-depth: 0 # Allows checkout of Artifacts.toml from base ref - uses: dawidd6/action-download-artifact@v3 - if: ${{ needs.prerelease.outputs.key }} + if: ${{ needs.unpublished.outputs.key }} id: action-artifact with: workflow: Build.yaml - name: ${{ needs.prerelease.outputs.key }} + name: ${{ needs.unpublished.outputs.key }} - name: Clear cached Overrides.toml - if: ${{ !needs.prerelease.outputs.key }} + if: ${{ !needs.unpublished.outputs.key }} run: rm -f ~/.julia/artifacts/Overrides.toml - run: | set -x @@ -74,14 +75,14 @@ jobs: mv Artifacts.toml NewArtifacts.toml git checkout origin/${{ github.base_ref }} -- Artifacts.toml - artifact_dir="$HOME/.julia/artifacts/${{ needs.prerelease.outputs.content_hash }}" + artifact_dir="$HOME/.julia/artifacts/${{ needs.unpublished.outputs.content_hash }}" mkdir -p "$artifact_dir" - tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C "$artifact_dir" + tar xvf ${{ needs.unpublished.outputs.tarball_filename }} -C "$artifact_dir" # Why doesn't this work? # cat > ~/.julia/artifacts/Overrides.toml < ~/.julia/artifacts/Overrides.toml < Date: Mon, 29 Jan 2024 23:56:57 -0600 Subject: [PATCH 33/63] Fixes --- .github/workflows/CI.yml | 2 +- .github/workflows/Release.yaml | 2 +- test/runtests.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f19db4e..95b43de 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: unpublished: - name: Check for unpublished artifact + name: Artifact Check runs-on: ubuntu-latest outputs: key: ${{ steps.key.outputs.key }} diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index 2ae6cbb..e70a157 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -16,7 +16,7 @@ jobs: id: details shell: julia --color=yes {0} run: | - using Pkg.Type: read_project + using Pkg.Types: read_project include(joinpath(pwd(), "gen", "artifacts.jl")) (; key, tarball_filename) = gh_artifact() project = read_project("Project.toml") diff --git a/test/runtests.jl b/test/runtests.jl index d2ff5b4..a3197a7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -60,7 +60,7 @@ end url = toml["tzjdata"]["download"][1]["url"] @test contains(url, "/v$(project.version)/") - @test basename(url) == basename(tarball_path)) + @test basename(url) == basename(tarball_path) @test contains(basename(url), r"tzdata(?\d{2}\d{2}?[a-z])") end end From 890ad365b0d0e44a99b509109fa81bc0db440830 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 00:01:06 -0600 Subject: [PATCH 34/63] Fix tests --- test/runtests.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index a3197a7..b8791b3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,7 @@ +using Artifacts: Artifacts using Base: SHA1 using CodecZlib: GzipDecompressorStream +using Pkg.Types: read_project using SHA: sha256 using TZJData using Tar: Tar @@ -52,13 +54,13 @@ end tarball_path = get(ENV, "TZJDATA_TARBALL_PATH", nothing) if !isnothing(artifact_toml) && !isnothing(tarball_path) project = read_project(joinpath(@__DIR__(), "..", "Project.toml")) - toml = TOML.parsefile(artifact_toml) + artifacts = Artifacts.parse_toml(artifact_toml) - @test toml["tzjdata"]["git-tree-sha1"] == tree_hash_sha1(tarball_path) - @test length(toml["tzjdata"]["download"]) == 1 - @test toml["tzjdata"]["download"][1]["sha256"] == sha256sum(tarball_path) + @test artifacts["tzjdata"]["git-tree-sha1"] == tree_hash_sha1(tarball_path) + @test length(artifacts["tzjdata"]["download"]) == 1 + @test artifacts["tzjdata"]["download"][1]["sha256"] == sha256sum(tarball_path) - url = toml["tzjdata"]["download"][1]["url"] + url = artifacts["tzjdata"]["download"][1]["url"] @test contains(url, "/v$(project.version)/") @test basename(url) == basename(tarball_path) @test contains(basename(url), r"tzdata(?\d{2}\d{2}?[a-z])") From c01a213f2323fed54dcd00f04aa9016c389f0e88 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 00:09:03 -0600 Subject: [PATCH 35/63] Iterating --- .github/workflows/Build.yaml | 14 +++++++++++++- gen/make.jl | 7 +++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 3689cc6..ebe233b 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -28,12 +28,16 @@ jobs: shell: julia --color=yes {0} run: | include(joinpath(pwd(), "gen", "make.jl")) - (; tarball_path, tarball_sha256) = update_tzdata() + (; tarball_path, tarball_sha256, new_version, commit_message) = update_tzdata() @show tarball_path open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$(basename(tarball_path))-$(tarball_sha256)") println(io, "tarball_path=$tarball_path") + println(io, "commit_message=$commit_message") + println(io, "branch=gh/v$(new_version)") end + println(io, "commit_message=$commit_message") + println("branch=gh/v$(new_version)") - name: Debug run: | echo "${{ steps.build.outputs.tarball_path }}" @@ -43,3 +47,11 @@ jobs: with: name: ${{ steps.build.outputs.key }} path: ${{ steps.build.outputs.tarball_path }} + # - name: Create Pull Request + # uses: peter-evans/create-pull-request@v5 + # with: + # add-paths: | + # Project.toml + # Artifacts.toml + # commit-message: ${{ steps.build.outputs.commit_message }} + # branch: ${{ steps.build.outputs.branch }} diff --git a/gen/make.jl b/gen/make.jl index 81acc42..75ecf06 100644 --- a/gen/make.jl +++ b/gen/make.jl @@ -167,6 +167,8 @@ function update_tzdata() force=true, ) + commit_message = "Set artifact to tzdata$(new_tzdata_version) and project to $(new_version)" + return (; repo_path, project_toml, @@ -178,6 +180,7 @@ function update_tzdata() new_tzdata_version, old_version, new_version, + commit_message, ) end @@ -191,12 +194,12 @@ if abspath(PROGRAM_FILE) == @__FILE__ artifacts_toml, artifact_url, tarball_path, + commit_message, ) = update_tzdata() # TODO: Ensure no other files are staged before committing @info "Committing and pushing Project.toml and Artifacts.toml" branch = "main" - message = "Set artifact to tzdata$(new_tzdata_version) and project to $(new_version)" # TODO: ghr and LibGit2 use different credential setups. Double check # what BB does here. @@ -205,7 +208,7 @@ if abspath(PROGRAM_FILE) == @__FILE__ # TODO: This allows empty commits LibGit2.add!(repo, basename(artifacts_toml)) LibGit2.add!(repo, basename(project_toml)) - LibGit2.commit(repo, message) + LibGit2.commit(repo, commit_message) # Same as "refs/heads/$branch" but fails if branch doesn't exist locally branch_ref = LibGit2.lookup_branch(repo, branch) From 1db9d5c0a6ee3213f42741cee3401960f5858d67 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 00:10:12 -0600 Subject: [PATCH 36/63] Test fix --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index b8791b3..eee45c8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -58,7 +58,7 @@ end @test artifacts["tzjdata"]["git-tree-sha1"] == tree_hash_sha1(tarball_path) @test length(artifacts["tzjdata"]["download"]) == 1 - @test artifacts["tzjdata"]["download"][1]["sha256"] == sha256sum(tarball_path) + @test artifacts["tzjdata"]["download"][1]["sha256"] == string(sha256sum(tarball_path)) url = artifacts["tzjdata"]["download"][1]["url"] @test contains(url, "/v$(project.version)/") From ae92514529d4f288959716930ec00011368d5ebd Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 00:11:13 -0600 Subject: [PATCH 37/63] fixup! Iterating --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index ebe233b..9dd3daa 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -36,7 +36,7 @@ jobs: println(io, "commit_message=$commit_message") println(io, "branch=gh/v$(new_version)") end - println(io, "commit_message=$commit_message") + println("commit_message=$commit_message") println("branch=gh/v$(new_version)") - name: Debug run: | From b3e6670fbe6cba010de6cab623ea9d88cd7ce659 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:15:59 -0600 Subject: [PATCH 38/63] Update package version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 688d77f..faf80c5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TZJData" uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" authors = ["Curtis Vogt "] -version = "1.0.0+2023c" +version = "1.1.0+2023d" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" From af2e8c782f51ba0c8453851930c33c35df801d69 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:19:28 -0600 Subject: [PATCH 39/63] Try out PR creation --- .github/workflows/Build.yaml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 9dd3daa..3eb54b5 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -29,15 +29,13 @@ jobs: run: | include(joinpath(pwd(), "gen", "make.jl")) (; tarball_path, tarball_sha256, new_version, commit_message) = update_tzdata() - @show tarball_path + key = basename(tarball_path)) * "-" * tarball_sha256 + @show key tarball_path commit_message open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$(basename(tarball_path))-$(tarball_sha256)") println(io, "tarball_path=$tarball_path") println(io, "commit_message=$commit_message") - println(io, "branch=gh/v$(new_version)") end - println("commit_message=$commit_message") - println("branch=gh/v$(new_version)") - name: Debug run: | echo "${{ steps.build.outputs.tarball_path }}" @@ -47,11 +45,11 @@ jobs: with: name: ${{ steps.build.outputs.key }} path: ${{ steps.build.outputs.tarball_path }} - # - name: Create Pull Request - # uses: peter-evans/create-pull-request@v5 - # with: - # add-paths: | - # Project.toml - # Artifacts.toml - # commit-message: ${{ steps.build.outputs.commit_message }} - # branch: ${{ steps.build.outputs.branch }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + add-paths: | + Project.toml + Artifacts.toml + commit-message: ${{ steps.build.outputs.commit_message }} + branch: gh/update-tzdata From 1042ea12e330c8c142b752a92ac5315aca3d9f12 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:19:32 -0600 Subject: [PATCH 40/63] Fix tests --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index eee45c8..2add4ff 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -56,9 +56,9 @@ end project = read_project(joinpath(@__DIR__(), "..", "Project.toml")) artifacts = Artifacts.parse_toml(artifact_toml) - @test artifacts["tzjdata"]["git-tree-sha1"] == tree_hash_sha1(tarball_path) + @test artifacts["tzjdata"]["git-tree-sha1"] == string(tree_hash_sha1(tarball_path)) @test length(artifacts["tzjdata"]["download"]) == 1 - @test artifacts["tzjdata"]["download"][1]["sha256"] == string(sha256sum(tarball_path)) + @test artifacts["tzjdata"]["download"][1]["sha256"] == sha256sum(tarball_path) url = artifacts["tzjdata"]["download"][1]["url"] @test contains(url, "/v$(project.version)/") From f8de28db2eb690fc7df9105a28ed4cd4349d2f4c Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:23:13 -0600 Subject: [PATCH 41/63] Fix key --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 3eb54b5..49e3c4e 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -29,7 +29,7 @@ jobs: run: | include(joinpath(pwd(), "gen", "make.jl")) (; tarball_path, tarball_sha256, new_version, commit_message) = update_tzdata() - key = basename(tarball_path)) * "-" * tarball_sha256 + key = basename(tarball_path) * "-" * tarball_sha256 @show key tarball_path commit_message open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$(basename(tarball_path))-$(tarball_sha256)") From fda4856ce49122e97b9ada436aee791966c20a2f Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:23:20 -0600 Subject: [PATCH 42/63] Set workflow permissions --- .github/workflows/Build.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 49e3c4e..6300964 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -10,6 +10,11 @@ on: jobs: build: runs-on: ubuntu-latest + # These permissions are needed to: + # - Create PRs: https://github.com/marketplace/actions/create-pull-request#workflow-permissions + permissions: + contents: write + pull-requests: write env: JULIA_PROJECT: gen steps: From 8f57db7323072334856801ae19b1ebe795f357ce Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:28:21 -0600 Subject: [PATCH 43/63] Test origin/HEAD --- .github/workflows/Build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 6300964..9918112 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -19,6 +19,8 @@ jobs: JULIA_PROJECT: gen steps: - uses: actions/checkout@v4 + with: + ref: origin/HEAD - uses: julia-actions/setup-julia@v1 with: version: "1" From a972d1809285d3829bff9d158c9a6338409dd0ce Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:30:39 -0600 Subject: [PATCH 44/63] Use main --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 9918112..ebef328 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: origin/HEAD + ref: main - uses: julia-actions/setup-julia@v1 with: version: "1" From 15ff6c9489029f70fec45d02913cc6ca0b5e91d1 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:32:46 -0600 Subject: [PATCH 45/63] Fix ref --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index ebef328..3ed30d3 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: main + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'main' }} - uses: julia-actions/setup-julia@v1 with: version: "1" From 3177980e0b309c351ea8590460be4c7bbde47bd3 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:34:52 -0600 Subject: [PATCH 46/63] Set base --- .github/workflows/Build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 3ed30d3..91a282f 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -55,6 +55,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: + base: main # Shouldn't be required for `workflow_dispatch` add-paths: | Project.toml Artifacts.toml From f2f8ac703e5e4f608b8ecc34138c0ee749b4c38a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:40:07 -0600 Subject: [PATCH 47/63] Iterating --- .github/workflows/Build.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 91a282f..1e4dd2e 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -39,14 +39,11 @@ jobs: key = basename(tarball_path) * "-" * tarball_sha256 @show key tarball_path commit_message open(ENV["GITHUB_OUTPUT"], "a") do io - println(io, "key=$(basename(tarball_path))-$(tarball_sha256)") + println(io, "key=$key") println(io, "tarball_path=$tarball_path") println(io, "commit_message=$commit_message") end - - name: Debug - run: | - echo "${{ steps.build.outputs.tarball_path }}" - git diff + - run: git diff - uses: actions/upload-artifact@v4 id: action-artifact with: @@ -56,6 +53,9 @@ jobs: uses: peter-evans/create-pull-request@v5 with: base: main # Shouldn't be required for `workflow_dispatch` + title: ${{ steps.build.outputs.commit_message }} + body: >- + An automated PR generated by the workflow [Build.yaml](/.github/workflow/Build.yaml). add-paths: | Project.toml Artifacts.toml From 34802b66c473ff04d8d2ac47b585168a6610388a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:42:26 -0600 Subject: [PATCH 48/63] Fix workflow link --- .github/workflows/Build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 1e4dd2e..5efc981 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -55,7 +55,7 @@ jobs: base: main # Shouldn't be required for `workflow_dispatch` title: ${{ steps.build.outputs.commit_message }} body: >- - An automated PR generated by the workflow [Build.yaml](/.github/workflow/Build.yaml). + An automated PR generated by the [Build.yaml](/${{ github.workflow_ref }}) workflow. add-paths: | Project.toml Artifacts.toml From ecb84d3e3824c1e6b866e13c82cc664ae24ea163 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:47:14 -0600 Subject: [PATCH 49/63] Link is broken --- .github/workflows/Build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 5efc981..00420e5 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -43,6 +43,7 @@ jobs: println(io, "tarball_path=$tarball_path") println(io, "commit_message=$commit_message") end + println("workflow_ref=${{ github.workflow_ref }}") - run: git diff - uses: actions/upload-artifact@v4 id: action-artifact @@ -55,7 +56,7 @@ jobs: base: main # Shouldn't be required for `workflow_dispatch` title: ${{ steps.build.outputs.commit_message }} body: >- - An automated PR generated by the [Build.yaml](/${{ github.workflow_ref }}) workflow. + An automated PR generated by the ${{ github.workflow }} workflow. add-paths: | Project.toml Artifacts.toml From 8de2f0f291520bb320a1bf290b03663633e48361 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:53:39 -0600 Subject: [PATCH 50/63] Try PAT for PR --- .github/workflows/Build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 00420e5..b046219 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -62,3 +62,4 @@ jobs: Artifacts.toml commit-message: ${{ steps.build.outputs.commit_message }} branch: gh/update-tzdata + token: ${{ secrets.TZJDATA_UPDATE_TOKEN }} From 20ce0532fc9405e4d64d2cab2a78e2211fe473b1 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:55:46 -0600 Subject: [PATCH 51/63] Change something about the PR --- .github/workflows/Build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index b046219..841023a 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -37,6 +37,7 @@ jobs: include(joinpath(pwd(), "gen", "make.jl")) (; tarball_path, tarball_sha256, new_version, commit_message) = update_tzdata() key = basename(tarball_path) * "-" * tarball_sha256 + commit_message *= " (1)" @show key tarball_path commit_message open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$key") @@ -45,6 +46,8 @@ jobs: end println("workflow_ref=${{ github.workflow_ref }}") - run: git diff + # Store the Julia artifact tarball as a GitHub actions artifact. This will allow us to retrieve this + # tarball from other workflows. - uses: actions/upload-artifact@v4 id: action-artifact with: From 0eed109344c7d329c78e674054261df6c18fc64e Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 14:57:21 -0600 Subject: [PATCH 52/63] Another PR is required? --- .github/workflows/Build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 841023a..40773b9 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -37,7 +37,6 @@ jobs: include(joinpath(pwd(), "gen", "make.jl")) (; tarball_path, tarball_sha256, new_version, commit_message) = update_tzdata() key = basename(tarball_path) * "-" * tarball_sha256 - commit_message *= " (1)" @show key tarball_path commit_message open(ENV["GITHUB_OUTPUT"], "a") do io println(io, "key=$key") @@ -64,5 +63,5 @@ jobs: Project.toml Artifacts.toml commit-message: ${{ steps.build.outputs.commit_message }} - branch: gh/update-tzdata + branch: gh/update-tzdata1 token: ${{ secrets.TZJDATA_UPDATE_TOKEN }} From bfa14012c631d8fc7fddd07b6a5ce65bf0a1cbba Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:04:32 -0600 Subject: [PATCH 53/63] Iterating --- .github/workflows/Build.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 40773b9..cc4caff 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -1,12 +1,9 @@ --- name: Build on: - pull_request: - workflow_dispatch: - inputs: - tzdata_version: - required: true - type: string + pull_request: {} + schedule: + - cron: "*/5 * * * *" # Every 5 minutes (for now) jobs: build: runs-on: ubuntu-latest @@ -63,5 +60,6 @@ jobs: Project.toml Artifacts.toml commit-message: ${{ steps.build.outputs.commit_message }} - branch: gh/update-tzdata1 - token: ${{ secrets.TZJDATA_UPDATE_TOKEN }} + branch: gh/update-tzdata + delete-branch: ${{ github.event_name == 'pull_request' }} + token: ${{ secrets.TZJDATA_UPDATE_TOKEN }} # TODO: Fine-grained token expires From 1a17a2695ee8c25d7730aa2b79cd200e94636c14 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:06:49 -0600 Subject: [PATCH 54/63] Finish rename --- .github/workflows/CI.yml | 2 +- .github/workflows/Release.yaml | 2 +- .github/workflows/{Build.yaml => Update.yaml} | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename .github/workflows/{Build.yaml => Update.yaml} (98%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 95b43de..33eae96 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,7 +64,7 @@ jobs: if: ${{ needs.unpublished.outputs.key }} id: action-artifact with: - workflow: Build.yaml + workflow: Update.yaml name: ${{ needs.unpublished.outputs.key }} - name: Clear cached Overrides.toml if: ${{ !needs.unpublished.outputs.key }} diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index e70a157..14dfdb2 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -28,7 +28,7 @@ jobs: - uses: dawidd6/action-download-artifact@v3 id: action-artifact with: - workflow: Build.yaml + workflow: Update.yaml name: ${{ needs.details.outputs.key }} # - name: Build Changelog # id: build_changelog diff --git a/.github/workflows/Build.yaml b/.github/workflows/Update.yaml similarity index 98% rename from .github/workflows/Build.yaml rename to .github/workflows/Update.yaml index cc4caff..842d42f 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Update.yaml @@ -1,11 +1,12 @@ --- -name: Build +name: Update on: pull_request: {} schedule: - cron: "*/5 * * * *" # Every 5 minutes (for now) jobs: - build: + artifacts: + name: Artifacts runs-on: ubuntu-latest # These permissions are needed to: # - Create PRs: https://github.com/marketplace/actions/create-pull-request#workflow-permissions From 5f7e8f0691c8b496f390d14b0a7efc51b9088dd3 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:14:32 -0600 Subject: [PATCH 55/63] Attempt making a release --- .github/workflows/CI.yml | 2 ++ .github/workflows/Release.yaml | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 33eae96..a8eb667 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,6 +4,8 @@ on: push: branches: - main + paths: + - "!Artifacts.toml" # Impending package release. Will trigger via `tags` tags: ["*"] concurrency: # Skip intermediate builds: on all builds except on the "main" branch. diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index 14dfdb2..a641bb3 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -5,7 +5,7 @@ on: branches: - main paths: - - Artifacts.toml + - "Artifacts.toml" jobs: publish: name: Publish @@ -30,12 +30,12 @@ jobs: with: workflow: Update.yaml name: ${{ needs.details.outputs.key }} - # - name: Build Changelog - # id: build_changelog - # uses: mikepenz/release-changelog-builder-action@v4 - # - name: Publish Release - # uses: ncipollo/release-action@v1 - # with: - # tag: ${{ steps.details.outputs.tag }} - # artifacts: ./${{ steps.details.outputs.tarball_filename }} - # body: ${{ steps.build_changelog.outputs.changelog }} \ No newline at end of file + - name: Build Changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v4 + - name: Publish Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.details.outputs.tag }} + artifacts: ./${{ steps.details.outputs.tarball_filename }} + body: ${{ steps.build_changelog.outputs.changelog }} \ No newline at end of file From c2e16a6065c6863cadd89482fff5bf0a727f240a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:16:28 -0600 Subject: [PATCH 56/63] Fix artifacts pattern --- .github/workflows/Release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index a641bb3..26f3013 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -37,5 +37,5 @@ jobs: uses: ncipollo/release-action@v1 with: tag: ${{ steps.details.outputs.tag }} - artifacts: ./${{ steps.details.outputs.tarball_filename }} + artifacts: ${{ steps.details.outputs.tarball_filename }} body: ${{ steps.build_changelog.outputs.changelog }} \ No newline at end of file From 5a6360f8c1f27064cb14ff1156f63f13ef0f8e67 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:23:21 -0600 Subject: [PATCH 57/63] Tweak --- .github/workflows/Release.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index 26f3013..742c23e 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -10,6 +10,10 @@ jobs: publish: name: Publish runs-on: ubuntu-latest + # These permissions are needed to: + # - Create a GitHub release: https://github.com/ncipollo/release-action#notes + permissions: + contents: write steps: - uses: actions/checkout@v4 - name: Determine artifact details @@ -30,6 +34,7 @@ jobs: with: workflow: Update.yaml name: ${{ needs.details.outputs.key }} + - run: ls -l - name: Build Changelog id: build_changelog uses: mikepenz/release-changelog-builder-action@v4 @@ -37,5 +42,6 @@ jobs: uses: ncipollo/release-action@v1 with: tag: ${{ steps.details.outputs.tag }} + body: ${{ steps.build_changelog.outputs.changelog }} artifacts: ${{ steps.details.outputs.tarball_filename }} - body: ${{ steps.build_changelog.outputs.changelog }} \ No newline at end of file + artifactErrorsFailBuild: true From cb49b13b68cbd2c10450a1f66530085121ca7a17 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:30:36 -0600 Subject: [PATCH 58/63] Fixes --- .github/workflows/CI.yml | 17 ++++++++++++----- .github/workflows/Release.yaml | 3 +-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a8eb667..59c6d90 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -71,15 +71,20 @@ jobs: - name: Clear cached Overrides.toml if: ${{ !needs.unpublished.outputs.key }} run: rm -f ~/.julia/artifacts/Overrides.toml - - run: | - set -x + - name: Create artifacts Overrides.toml + if: ${{ needs.unpublished.outputs.key }} + run: | + set -ex + tarball_path="$PWD/${{ needs.unpublished.outputs.tarball_filename }}" + [ -f "$tarball_path" ] || exit 1 + # A valid Artifacts.toml file is required: Pkg.jl issue #2662 mv Artifacts.toml NewArtifacts.toml git checkout origin/${{ github.base_ref }} -- Artifacts.toml artifact_dir="$HOME/.julia/artifacts/${{ needs.unpublished.outputs.content_hash }}" mkdir -p "$artifact_dir" - tar xvf ${{ needs.unpublished.outputs.tarball_filename }} -C "$artifact_dir" + tar xvf "$tarball_path" -C "$artifact_dir" # Why doesn't this work? # cat > ~/.julia/artifacts/Overrides.toml < Date: Tue, 30 Jan 2024 15:32:34 -0600 Subject: [PATCH 59/63] Ensure release action fails before making release --- .github/workflows/Release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index a517898..e5489c1 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -34,6 +34,9 @@ jobs: with: workflow: Update.yaml name: ${{ steps.details.outputs.key }} + # - name: Validate artifact retrieved + # run: | + # [ -f "${{ steps.details.outputs.tarball_filename }}" ] || exit 1 - name: Build Changelog id: build_changelog uses: mikepenz/release-changelog-builder-action@v4 @@ -42,5 +45,5 @@ jobs: with: tag: ${{ steps.details.outputs.tag }} body: ${{ steps.build_changelog.outputs.changelog }} - artifacts: ${{ steps.details.outputs.tarball_filename }} + artifacts: ${{ steps.details.outputs.tarball_filename }}x artifactErrorsFailBuild: true From 51ffb816b5545ff825d1d87fa9a74eb0a423b7c4 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:35:19 -0600 Subject: [PATCH 60/63] Fail earlier --- .github/workflows/Release.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index e5489c1..e219067 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -33,10 +33,12 @@ jobs: id: action-artifact with: workflow: Update.yaml - name: ${{ steps.details.outputs.key }} - # - name: Validate artifact retrieved - # run: | - # [ -f "${{ steps.details.outputs.tarball_filename }}" ] || exit 1 + name: ${{ needs.details.outputs.key }} + # 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 + run: | + [ -f "${{ steps.details.outputs.tarball_filename }}" ] || exit 1 - name: Build Changelog id: build_changelog uses: mikepenz/release-changelog-builder-action@v4 @@ -45,5 +47,5 @@ jobs: with: tag: ${{ steps.details.outputs.tag }} body: ${{ steps.build_changelog.outputs.changelog }} - artifacts: ${{ steps.details.outputs.tarball_filename }}x + artifacts: ${{ steps.details.outputs.tarball_filename }} artifactErrorsFailBuild: true From 233d8e992134426d19b11ad708b26cfa17a48a72 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:37:05 -0600 Subject: [PATCH 61/63] Release should now work --- .github/workflows/Release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index e219067..f5c8509 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -33,7 +33,7 @@ jobs: id: action-artifact with: workflow: Update.yaml - name: ${{ needs.details.outputs.key }} + name: ${{ steps.details.outputs.key }} # 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 From 0d890093c40f19ae1416b703ad4b1f7f61a3f3a0 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:41:06 -0600 Subject: [PATCH 62/63] Ready to merge --- .github/workflows/Release.yaml | 1 - .github/workflows/Update.yaml | 1 - Artifacts.toml | 6 +++--- Project.toml | 12 ++---------- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index f5c8509..3b578a6 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -1,6 +1,5 @@ name: Release on: - pull_request: push: branches: - main diff --git a/.github/workflows/Update.yaml b/.github/workflows/Update.yaml index 842d42f..2d52feb 100644 --- a/.github/workflows/Update.yaml +++ b/.github/workflows/Update.yaml @@ -1,7 +1,6 @@ --- name: Update on: - pull_request: {} schedule: - cron: "*/5 * * * *" # Every 5 minutes (for now) jobs: diff --git a/Artifacts.toml b/Artifacts.toml index de0a78e..0ac9578 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [tzjdata] -git-tree-sha1 = "b071cffdb310f5d3ca640c09cfa3dc3f23d450ad" +git-tree-sha1 = "52e48e96c4df04eeebc6ece0d9f1c3b545f0544c" [[tzjdata.download]] - sha256 = "ff06bf7c19783925eff4430f1571c5cf81bf9232240dd2ee98d8a66987612f24" - url = "https://github.com/JuliaTime/TZJData.jl/releases/download/v1.1.0+2023d/tzjfile-v1-tzdata2023d.tar.gz" \ No newline at end of file + sha256 = "50cd6c70dfb582336b4223adb3fe76aca6c6a9a5982c3111001e2091fb947b66" + url = "https://github.com/JuliaTime/TZJData.jl/releases/download/v1.0.0+2023c/tzjfile-v1-tzdata2023c.tar.gz" diff --git a/Project.toml b/Project.toml index faf80c5..4547c79 100644 --- a/Project.toml +++ b/Project.toml @@ -1,26 +1,18 @@ name = "TZJData" uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" authors = ["Curtis Vogt "] -version = "1.1.0+2023d" +version = "1.0.0+2023c" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] -CodecZlib = "0.7" -SHA = "1.6" -Tar = "1" TimeZones = "1" julia = "1.6" [extras] -CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" -TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" [targets] -test = ["CodecZlib", "Pkg", "SHA", "TOML", "Tar", "Test", "TimeZones"] +test = ["TimeZones", "Test"] From 3e83df3e512249b6b410901d1230f6eab949a39a Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 30 Jan 2024 15:44:11 -0600 Subject: [PATCH 63/63] Only restore project version --- Project.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4547c79..688d77f 100644 --- a/Project.toml +++ b/Project.toml @@ -7,12 +7,20 @@ version = "1.0.0+2023c" Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] +CodecZlib = "0.7" +SHA = "1.6" +Tar = "1" TimeZones = "1" julia = "1.6" [extras] +CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" +TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" [targets] -test = ["TimeZones", "Test"] +test = ["CodecZlib", "Pkg", "SHA", "TOML", "Tar", "Test", "TimeZones"]