Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
acocalypso committed Apr 8, 2024
1 parent 36f811f commit a5c77b8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:

update-gist:
runs-on: ubuntu-latest
needs: [publish-tauri]
steps:
- name: Get latest release
id: get_latest_release
Expand All @@ -114,7 +115,25 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${latest_release_tag}/latest.json" \
-o latest.json
- name: Download latest.json
run: |
latest_release_tag=${{ steps.get_latest_release.outputs.result }}
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.RELEASE_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" \
-o latest.json
- name: Update Gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.TOKEN }}
gist_id: ${{ secrets.GIST_ID }}
file_path: latest.json
file_type: text
gist_description: "Updater JSON for the latest release"
gist_file_name: "latest.json"
- name: Update Gist
uses: exuanbo/actions-deploy-gist@v1
with:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/gist-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'gist-test'

on:
workflow_dispatch:

jobs:
update-gist:
runs-on: ubuntu-latest
steps:
- name: Get latest release
id: get_latest_release
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const response = await github.repos.getLatestRelease(context.repo);
return response.data.tag_name;
- name: Download latest.json
run: |
latest_release_tag=${{ steps.get_latest_release.outputs.result }}
release_info=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RELEASE_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${latest_release_tag}")
latest_json_url=$(echo "$release_info" | jq -r .tarball_url) # or use .zipball_url
curl -L "$latest_json_url" -o latest.json
- name: Update Gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.TOKEN }}
gist_id: ${{ secrets.GIST_ID }}
file_path: latest.json
file_type: text
gist_description: "Updater JSON for the latest release"
gist_file_name: "latest.json"

0 comments on commit a5c77b8

Please sign in to comment.