From 3c673701adc14d8c85031e573f351a7188723dc7 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 8 Jun 2021 21:33:19 -0400 Subject: [PATCH] Add a workflow to upload baseline images as a release asset (#1317) * Add a workflow to upload baseline images as a release asset * Add the new workflow to maintenance.md Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Meghan Jones --- .github/ISSUE_TEMPLATE/release_checklist.md | 2 +- .github/workflows/release-baseline-images.yml | 40 +++++++++++++++++++ doc/maintenance.md | 13 ++++-- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release-baseline-images.yml diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 60c1664791b..2b633e4fc7f 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -29,7 +29,7 @@ assignees: '' - [ ] Edit the draft release notes with the finalized changelog - [ ] Set the tag version and release title to vX.Y.Z - [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too -- [ ] Manually upload the pygmt-vX.Y.Z.zip file to https://zenodo.org/deposit, ensure that it is filed under the correct reserved DOI +- [ ] Manually upload the pygmt-vX.Y.Z.zip and baseline-images.zip files to https://zenodo.org/deposit, ensure that it is filed under the correct reserved DOI **After release**: - [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Usually done automatically by conda-forge's bot] diff --git a/.github/workflows/release-baseline-images.yml b/.github/workflows/release-baseline-images.yml new file mode 100644 index 00000000000..b7eac878e6f --- /dev/null +++ b/.github/workflows/release-baseline-images.yml @@ -0,0 +1,40 @@ +# Upload the ZIP archive of baseline images as a release asset + +name: Upload baseline images + +# Only run for releases +on: + release: + types: + - published + +jobs: + upload-baseline: + name: Upload baseline images + runs-on: ubuntu-latest + if: github.repository == 'GenericMappingTools/pygmt' + + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + + - name: Setup data version control (DVC) + uses: iterative/setup-dvc@v1.0.3 + + - name: Pull baseline image data from dvc remote + run: | + dvc pull + ls -lhR pygmt/tests/baseline/ + + - name: Create the baseline image asset in zip format + run: | + mkdir baseline-images + mv pygmt/tests/baseline/*.png baseline-images/ + zip -r baseline-images.zip baseline-images + shasum -a 256 baseline-images.zip + + - name: Upload baseline image as a release asset + uses: shogo82148/actions-upload-release-asset@v1.3.0 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: baseline-images.zip diff --git a/doc/maintenance.md b/doc/maintenance.md index 8825fb78b14..d9f4ed4928e 100644 --- a/doc/maintenance.md +++ b/doc/maintenance.md @@ -32,7 +32,7 @@ A few guidelines for managing GitHub issues: [milestone](https://github.com/GenericMappingTools/pygmt/milestones) to issues as appropriate. * When people request to work on an open issue, either assign the issue to that person - and post a comment about the assignment or explain why you are not assigning the + and post a comment about the assignment or explain why you are not assigning the issue to them and, if possible, recommend other issues for them to work on. * People with write access should self-assign issues and/or comment on the issues that they will address. @@ -69,7 +69,7 @@ build and test the project on Linux, macOS and Windows. They rely on the `environment.yml` file to install required dependencies using conda and the `Makefile` to run the tests and checks. -There are 9 configuration files located in `.github/workflows`: +There are 11 configuration files located in `.github/workflows`: 1. `style_checks.yaml` (Code lint and style checks) @@ -138,6 +138,11 @@ There are 9 configuration files located in `.github/workflows`: modified, or deleted. A GitHub comment will be published that contains a summary table of the images that have changed along with a visual report. +11. `release-baseline-images.yml` (Upload the ZIP archive of baseline images as a release asset) + + This workflow is run to upload the ZIP archive of baseline images as a release + asset when a release is published. + ## Continuous Documentation We use the [Vercel for GitHub](https://github.com/apps/vercel) App to preview changes @@ -276,8 +281,8 @@ this new folder. ### Archiving on Zenodo -Grab a zip file from the GitHub release and upload to Zenodo using the previously -reserved DOI. +Grab both the source code and baseline images zip files from the GitHub release page +and upload them to Zenodo using the previously reserved DOI. ### Updating the conda package