From 9881fc59c814761ea2b4a56b7e9c49a561d7180d Mon Sep 17 00:00:00 2001 From: Emiliano Heyns Date: Mon, 30 Nov 2020 01:46:15 +0100 Subject: [PATCH] Ping on push, not PR, document role of dist-updater (#5137) --- .github/workflows/merge.yaml | 38 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index 32acf22090..285fd219ce 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -24,16 +24,19 @@ jobs: with: fetch-depth: 0 + - name: Release branch version + id: release + run: echo ::set-output name=branch::v1.0.1 - name: Checkout release branch uses: actions/checkout@v2 with: - ref: 'v1.0.1' + ref: ${{ steps.release.outputs.branch }} path: './release' - name: Check for relevant changes if: github.event_name == 'push' uses: dorny/paths-filter@v2 - id: release + id: update with: list-files: shell filters: | @@ -45,16 +48,16 @@ jobs: - name: Changed files if: github.event_name == 'push' run: | - echo updated: ${{ steps.release.outputs.updated_files }} - echo deleted: ${{ steps.release.outputs.deleted_files }} + echo updated: ${{ steps.update.outputs.updated_files }} + echo deleted: ${{ steps.update.outputs.deleted_files }} - name: Set up Ruby - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.update.outputs.updated == 'true' || steps.update.outputs.deleted == 'true')) uses: ruby/setup-ruby@v1 with: ruby-version: 2.7.1 - name: but use cache to speed that up - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.update.outputs.updated == 'true' || steps.update.outputs.deleted == 'true')) uses: actions/cache@v2 with: path: vendor/bundle @@ -62,7 +65,7 @@ jobs: restore-keys: | ${{ runner.os }}-gems- - name: Bundle install - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.update.outputs.updated == 'true' || steps.update.outputs.deleted == 'true')) run: | bundle config path vendor/bundle bundle update sheldon --jobs 4 --retry 3 @@ -72,18 +75,18 @@ jobs: if: github.event_name == 'workflow_dispatch' - name: update the timestamps and add the changes - run: bundle exec sheldon --token=$GITHUB_TOKEN --verbose --release release ${{ steps.release.outputs.updated_files }} - if: github.event_name == 'push' && steps.release.outputs.updated == 'true' + run: bundle exec sheldon --token=$GITHUB_TOKEN --verbose --release release ${{ steps.update.outputs.updated_files }} + if: github.event_name == 'push' && steps.update.outputs.updated == 'true' - name: delete deleted files - run: cd release && git rm ${{ steps.release.outputs.deleted_files }} - if: github.event_name == 'push' && steps.release.outputs.deleted == 'true' + run: cd release && git rm ${{ steps.update.outputs.deleted_files }} + if: github.event_name == 'push' && steps.update.outputs.deleted == 'true' - uses: stefanzweifel/git-auto-commit-action@v4 with: repository: 'release' - commit_message: Releasing ${{ steps.release.outputs.updated_files }} ${{ steps.release.outputs.deleted_files }} - if: github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true') + commit_message: Releasing ${{ steps.update.outputs.updated_files }} ${{ steps.update.outputs.deleted_files }} + if: github.event_name == 'push' && (steps.update.outputs.updated == 'true' || steps.update.outputs.deleted == 'true') - uses: stefanzweifel/git-auto-commit-action@v4 with: @@ -91,8 +94,11 @@ jobs: commit_message: ${{ github.event.inputs.commit_message }} if: github.event_name == 'workflow_dispatch' - - name: ping distribution-updater + # https://styles-update.zotero.org:8826/ is for Zotero (styles page, API's citation server, client style updates, etc.) + # https://styles-update.zotero.org:8827/ is for the Zotero-run instance of https://github.com/citation-style-language/distribution-updater + # that performs the updating of the (to-be-deprecated) https://github.com/citation-style-language/styles-distribution/ repo + - name: ping Zotero servers if: github.repository == 'citation-style-language/styles' run: | - curl -H 'Content-Length:' -H "Authorization: $DISTRIBUTION_UPDATER_TOKEN" -F 'payload={"type":"pull_request","branch":"master","status":0,"commit":"'$GITHUB_SHA'"}' https://styles-update.zotero.org:8826/ - curl -H 'Content-Length:' -H "Authorization: $DISTRIBUTION_UPDATER_TOKEN" -F 'payload={"type":"pull_request","branch":"master","status":0,"commit":"'$GITHUB_SHA'"}' https://styles-update.zotero.org:8827/ + curl -H 'Content-Length:' -H "Authorization: $ZOTERO_UPDATE_TOKEN" -F 'payload={"type":"push","branch":"${{ steps.release.outputs.branch }}","status":0,"commit":"'$GITHUB_SHA'"}' https://styles-update.zotero.org:8826/ + curl -H 'Content-Length:' -H "Authorization: $ZOTERO_UPDATE_TOKEN" -F 'payload={"type":"push","branch":"${{ steps.release.outputs.branch }}","status":0,"commit":"'$GITHUB_SHA'"}' https://styles-update.zotero.org:8827/