From 94c546abb61cc7f090421705d4ee35e158290e61 Mon Sep 17 00:00:00 2001 From: Jubal Mabaquiao Date: Wed, 28 Feb 2024 23:28:16 +0800 Subject: [PATCH] Add workflow step to publish a release (#261) * add workflow step to publish a release * use github builtin env * add step creating reference to ipfs hash * remove target_commitish --- .github/workflows/ipfs-deploy.yml | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/.github/workflows/ipfs-deploy.yml b/.github/workflows/ipfs-deploy.yml index 097c4863..7803ee9d 100644 --- a/.github/workflows/ipfs-deploy.yml +++ b/.github/workflows/ipfs-deploy.yml @@ -65,3 +65,73 @@ jobs: - name: Publish to nft.storage run: | docker run -e NFTSTORAGE_API_KEY=${{ secrets.NFTSTORAGE_API_KEY }} $IMAGE_RELEASE_ID nft.storage + + - name: Create a reference for IPFS hash + if: github.ref_type == 'tag' + run: | + echo "IPFS_HASH=$(docker run --entrypoint /bin/sh $IMAGE_RELEASE_ID -c 'cat /ipfs_hash.txt')" >> $GITHUB_ENV + + - name: Create a release + if: github.ref_type == 'tag' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Markdown template for the release notes + RELEASE_NOTE_TEMPLATE=$(cat << EOF + #### IPFS Hash + + \`\`\` + $IPFS_HASH + \`\`\` + + You can view published versions of Lunaria through any IPFS Gateway + + [ipfs://$IPFS_HASH](ipfs://$IPFS_HASH) __(Recommended)__ + _requires Brave Browser or IPFS Desktop_ + [https://$IPFS_HASH.ipfs.nftstorage.link](https://$IPFS_HASH.ipfs.nftstorage.link) + [https://$IPFS_HASH.ipfs.zoltu.io](https://$IPFS_HASH.ipfs.zoltu.io) + [https://$IPFS_HASH.ipfs.keydonix.com](https://$IPFS_HASH.ipfs.keydonix.com) + [https://$IPFS_HASH.ipfs.cf-ipfs.com](https://$IPFS_HASH.ipfs.cf-ipfs.com) + [https://$IPFS_HASH.ipfs.w3s.link](https://$IPFS_HASH.ipfs.w3s.link) + EOF + ) + + # Generate payload for creating a new release + PAYLOAD_TEMPLATE=$(cat <