From f512fdb7a6930e8e6ec80643dbf03bd7c790632e Mon Sep 17 00:00:00 2001 From: mralusw <46788176+mralusw@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:47:13 +0300 Subject: [PATCH] CI: use GitHub's gh tool and get rid of softprop and graphql-action (#73) * release.yml: use gh api graphql * release.yml: use 'gh release' Signed-off-by: Christian Brabandt --- .github/workflows/release.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a983625e..26c042ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,10 +20,10 @@ jobs: - name: Get latest tags id: latest-tags - uses: octokit/graphql-action@v2.x 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) { @@ -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 @@ -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"