-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate artifacts using gh-actions (#372)
* Generate single artifact * Create artifacts.yml * Remove erroneous - * Correct path * Use archive_artifact correctly * Add tag_name * Correctly generate artifact * Update Artifacts.toml after generating artifacts * Rename * Update Artifacts.toml * Remove old tag before release * Update Artifacts.toml * Use ncipollo/release-action Allows to replace tags * Update Artifacts.toml * Fix deprecation in ncipollo/release-action * Update Artifacts.toml * Fix typo * Update Artifacts.toml * Hopefully enable update of release artifacts * Update Artifacts.toml * Obtain schema correctly * Obtain schema correctly * Rename to plotly.min.js * Update Artifacts.toml * Rename for JuliaPlots repo * Rename for JuliaPlots repo * Update Artifacts.toml * Do not update Artifact.toml automatically Compute SHA256 instead * Revert "Do not update Artifact.toml automatically" This reverts commit 21116a0. * Update Artifacts.toml * Update Artifacts.toml * Download artifacts directly without checksum Probably won't work... * Revert "Download artifacts directly without checksum" This reverts commit 038c23c. * Update Artifacts.toml * Blink.AtomShell.install() not needed anymore * Prepare artifact versioning * Bump julia version * Update Artifacts.toml for artifact version latest * Introduce artifact versioning * Fix bash string interpolation * Update Artifacts.toml for artifact version 1.58.4 * String interpolation in artifact release * Hopefully fix env usage * Update Artifacts.toml for artifact version 1.58.4 * Allow manual triggering * Fix artifact download link * Update Artifacts.toml for artifact version 1.58.4 * Get rid of try ... catch * Bump version number * Repo specifier in generate_artifacts * Repo specifier * Update Artifacts.toml for artifact version 1.58.4 * Update Artifacts.toml for artifact version 1.58.4 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
40c8c93
commit 810d322
Showing
8 changed files
with
82 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Artifacts | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab, do not run automatically | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "gen-artifacts" | ||
gen-artifacts: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# The plotly version. Bumping this environment variable should do the trick | ||
env: | ||
PLOTLY_VER: 1.58.4 | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
|
||
- name: "Set up Julia" | ||
uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: 1.6.0 | ||
|
||
- name: "Get artifact" | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
julia -e 'include(joinpath(pwd(),"deps","generate_artifacts.jl")); generate_artifacts("'"$PLOTLY_VER"'","'"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"'")' | ||
- name: "Commit updated Artifacts.toml" | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git commit -m "Update Artifacts.toml for artifact version $PLOTLY_VER" "Artifacts.toml" | ||
- name: "Push changes" | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
|
||
- name: "Release" | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifacts: "plotly-artifacts-${{ env.PLOTLY_VER }}.tar.gz" | ||
replacesArtifacts: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: "plotly-artifacts-${{ env.PLOTLY_VER }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
branches: [master] | ||
tags: [v*] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docdeploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[plotly-artifacts] | ||
git-tree-sha1 = "0fcbca3e2dac59d4a0f4f3b3fc2de36efe0ca4a1" | ||
git-tree-sha1 = "4fa45e1c116c49318fa3d60adb843b5db5c13069" | ||
|
||
[[plotly-artifacts.download]] | ||
sha256 = "499fa5e6a60b280c17513b13fbe5b99f37b96870446319bc27a37a137445ea6b" | ||
url = "https://github.com/thomasjm/PlotlyJS.jl/releases/download/v0.14/plotly.js-artifacts-1.57.1.tar.gz" | ||
sha256 = "c945e3724a3969e58dee5a9f00e80a256a5c098e0b4ac8c5838c5a538e186c9d" | ||
url = "https://github.com/jonas-kr/PlotlyJS.jl/releases/download/plotly-artifacts-1.58.4/plotly-artifacts-1.58.4.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "PlotlyJS" | ||
uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" | ||
authors = ["Spencer Lyon <[email protected]>"] | ||
version = "0.14.1" | ||
version = "0.15" | ||
|
||
[deps] | ||
Blink = "ad839575-38b3-5650-b840-f874b8c74a25" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
# This script gets run once, on a developer's machine, to generate artifacts | ||
using Pkg.Artifacts | ||
using Downloads | ||
|
||
artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml") | ||
function generate_artifacts(ver="latest",repo="https://github.com/JuliaPlots/PlotlyJS.jl") | ||
artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml") | ||
|
||
rm(artifacts_toml) | ||
# if Artifacts.toml does not exist we also do not have to remove it | ||
isfile(artifacts_toml) && rm(artifacts_toml) | ||
|
||
plotschema_url = "https://api.plot.ly/v2/plot-schema?sha1" | ||
plotschema_hash = create_artifact() do artifact_dir | ||
download(plotschema_url, joinpath(artifact_dir, "plotschema.json")) | ||
end | ||
bind_artifact!(artifacts_toml, "plotschema", plotschema_hash; download_info = [ | ||
(plotschema_url, plotschema_hash) | ||
]) | ||
plotschema_url = "https://api.plot.ly/v2/plot-schema?sha1" | ||
plotly_url = "https://cdn.plot.ly/plotly-$ver.min.js" | ||
|
||
plotlyartifacts_hash = create_artifact() do artifact_dir | ||
Downloads.download(plotschema_url, joinpath(artifact_dir, "plot-schema.json")) | ||
Downloads.download(plotly_url, joinpath(artifact_dir, "plotly.min.js")) | ||
end | ||
|
||
tarball_hash = archive_artifact(plotlyartifacts_hash, "plotly-artifacts-$ver.tar.gz") | ||
|
||
plotly_url = "https://cdn.plot.ly/plotly-latest.min.js" | ||
plotly_hash = create_artifact() do artifact_dir | ||
download(plotly_url, joinpath(artifact_dir, "plotly-latest.min.js")) | ||
bind_artifact!(artifacts_toml, "plotly-artifacts", plotlyartifacts_hash; download_info = [ | ||
("$repo/releases/download/plotly-artifacts-$ver/plotly-artifacts-$ver.tar.gz", tarball_hash) | ||
]) | ||
end | ||
bind_artifact!(artifacts_toml, "plotly", plotly_hash; download_info = [ | ||
(plotly_url, plotly_hash) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters