From ba17d318ae558646a2963df95dc8a9bf96108bee Mon Sep 17 00:00:00 2001 From: Max Revitt Date: Thu, 16 Mar 2023 03:40:42 +0000 Subject: [PATCH] fix(release): run download page update separately (#7112) Checksum not working as the file isn't available in the assets when run in the same job. --- .github/workflows/download-page.yml | 21 +++++++++++++++++++++ .github/workflows/release.yml | 7 +------ cmd/release/page/main.js | 4 +++- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/download-page.yml diff --git a/.github/workflows/download-page.yml b/.github/workflows/download-page.yml new file mode 100644 index 00000000000..813d66bfa9c --- /dev/null +++ b/.github/workflows/download-page.yml @@ -0,0 +1,21 @@ +name: Trigger After Release + +on: + workflow_run: + workflows: ["release"] + types: + - completed + +jobs: + after_release: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Publish downloads + run: | + cd cmd/release + docker buildx build --push --platform linux/amd64 --build-arg GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" -t thorax/download:latest . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 406d3f72545..372cdbe00da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,9 +52,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ steps.prepare.outputs.tag_name }} DOCKER_USERNAME: ${{ secrets.DOCKERHUB }} - DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }} - - - name: Publish downloads - run: | - cd cmd/release - docker buildx build --push --platform linux/amd64 --build-arg GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" -t thorax/download:latest . \ No newline at end of file + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }} \ No newline at end of file diff --git a/cmd/release/page/main.js b/cmd/release/page/main.js index 5c1c0af6616..4c4f9bddc37 100644 --- a/cmd/release/page/main.js +++ b/cmd/release/page/main.js @@ -1,4 +1,6 @@ -fetch("./data.json") +const cacheBuster = Math.floor(new Date().getTime() / (1000 * 60 * 5)); + +fetch("./data.json?cacheBuster=" + cacheBuster) .then((response) => response.json()) .then((data) => { const osList = ["linux", "darwin", "windows", "docker"];