Skip to content

Commit

Permalink
CI: use GitHub's gh tool and get rid of softprop and graphql-action (#73
Browse files Browse the repository at this point in the history
)

* release.yml: use gh api graphql
* release.yml: use 'gh release'

Signed-off-by: Christian Brabandt <[email protected]>
  • Loading branch information
mralusw authored Apr 9, 2024
1 parent 3914b6d commit f512fdb
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

- name: Get latest tags
id: latest-tags
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
owner: ${{ steps.param.outputs.owner }}
repo: ${{ steps.param.outputs.repo }}
query: |
query($owner:String!,$repo:String!) {
appimage: repository(owner:$owner, name:$repo) {
Expand All @@ -45,16 +45,19 @@ jobs:
}
}
}
owner: ${{ steps.param.outputs.owner }}
repo: ${{ steps.param.outputs.repo }}
jq_extract: >+
"vim_tag=" + .data.vim.refs.edges[0].node.name,
"appimage_tag=" + .data.appimage.refs.edges[0].node.name
run: |
gh api graphql -F owner="$owner" -F repo="$repo" -f query="$query" --jq "$jq_extract" | \
tee -a "$GITHUB_ENV"
- name: Check updates
id: check-updates
run: |
appimage_tag=${{ fromJSON(steps.latest-tags.outputs.data).appimage.refs.edges[0].node.name }}
vim_tag=${{ fromJSON(steps.latest-tags.outputs.data).vim.refs.edges[0].node.name }}
echo "appimagetag=${appimage_tag}" >> "$GITHUB_OUTPUT"
echo "updated=$([[ ${appimage_tag} != ${vim_tag} ]] && echo true)" >> "$GITHUB_OUTPUT"
printf >> "$GITHUB_OUTPUT" '%s\n' \
"appimagetag=${appimage_tag}" \
"updated=$([[ ${appimage_tag} != ${vim_tag} ]] && echo true)"
create-appimage-job:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -144,11 +147,10 @@ jobs:
git push --follow-tags -u origin "${GITHUB_REF_NAME}"
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: release.body
name: 'Vim: ${{ steps.commit.outputs.tag_name }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.commit.outputs.tag_name }}
files: |
*.AppImage
*.zsync
run: |
gh release create "$tag_name" \
*.AppImage *.zsync \
-F release.body -t "Vim: $tag_name"

0 comments on commit f512fdb

Please sign in to comment.