Skip to content

Commit

Permalink
change update gist
Browse files Browse the repository at this point in the history
  • Loading branch information
acocalypso committed Apr 8, 2024
1 parent 3894035 commit d212910
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,26 @@ jobs:

update-gist:
runs-on: ubuntu-latest
needs: [publish-tauri]
steps:
- name: Get latest release
id: get_latest_release
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const response = await github.repos.getLatestRelease({ owner, repo });
return response.data;
const response = await github.repos.getLatestRelease(context.repo);
return response.data.tag_name;
- name: Get latest release content
id: get_latest_release_content
run: |
latest_release_assets=$(curl -s "${{ steps.get_latest_release.outputs.url }}/assets")
latest_release_tag=${{ steps.get_latest_release.outputs.result }}
latest_release_assets=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/$latest_release_tag/assets")
latest_release_json=$(echo "$latest_release_assets" | jq '[.[] | {name: .name, download_url: .browser_download_url}]')
echo "::set-output name=latest_release_json::$latest_release_json"
- name: Create updater.json
run: |
current_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
latest_release_json=${{ steps.get_latest_release_content.outputs.latest_release_json }}
echo "$latest_release_json" > update.json
Expand All @@ -128,4 +126,4 @@ jobs:
file_path: update.json
file_type: text
gist_description: "Updater JSON for the latest release"
gist_file_name: "update.json"
gist_file_name: "update.json"

0 comments on commit d212910

Please sign in to comment.