-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a release when merged (#72)
- Loading branch information
1 parent
bb5a1dd
commit 81e6b43
Showing
1 changed file
with
44 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,29 +5,34 @@ on: | |
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
viteNetworkConfig: | ||
type: string | ||
required: false | ||
default: '' | ||
description: VITE Network config to pin. Blank == testing. e.g. netname.agoric.net | ||
|
||
jobs: | ||
deploy: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Build | ||
run: | | ||
find . | ||
yarn install | ||
if [[ "${{ inputs.viteNetworkConfig }}" != "" ]]; then | ||
export VITE_NETWORK_CONFIG_URL=https://${{ inputs.viteNetworkConfig }}/network-config | ||
fi | ||
yarn build | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT | ||
- name: Deploy on IPFS | ||
uses: aquiladev/ipfs-action@12cc5d253735dc2894fe19828bd042c8532acc5d #v0.3.1 | ||
id: ipfs | ||
|
@@ -38,14 +43,43 @@ jobs: | |
filebaseBucket: ${{ secrets.FILEBASE_BUCKET }} | ||
filebaseKey: ${{ secrets.FILEBASE_KEY }} | ||
filebaseSecret: ${{ secrets.FILEBASE_SECRET }} | ||
outputs: | ||
ipfs: ${{ steps.ipfs.outputs.ipfs }} | ||
|
||
annotate: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Convert IPFS Hash | ||
id: ipfsv1 | ||
run: | | ||
echo "v1hash=$(npx --yes [email protected] base32 ${{ steps.ipfs.outputs.ipfs }})" >> $GITHUB_OUTPUT | ||
echo "v1hash=$(npx --yes [email protected] base32 ${{ needs.build.outputs.ipfs }})" >> $GITHUB_OUTPUT | ||
- name: Add IPFS info to PR | ||
uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 #v2 | ||
with: | ||
message: | | ||
IPFS hash: `${{ steps.ipfs.outputs.ipfs }}` | ||
Network: ${{ inputs.viteNetworkConfig }} | ||
Commit: ${{ github.sha }} | ||
Ref: `${{ github.ref }}` | ||
IPFS v1 hash: `${{ steps.ipfsv1.outputs.v1hash }}` | ||
[CF](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.cf-ipfs.com) - [DWeb](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.dweb.link) - [4EVERLAND](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.4everland.io) | ||
outputs: | ||
v1hash: ${{ steps.ipfsv1.outputs.v1hash }} | ||
|
||
release: | ||
needs: annotate | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
body: | | ||
Network: ${{ inputs.viteNetworkConfig }} | ||
Commit: ${{ github.sha }} | ||
Ref: `${{ github.ref }}` | ||
IPFS v1 hash: `${{ needs.annotate.outputs.v1hash }}` | ||
[CF](https://${{ needs.annotate.outputs.v1hash }}.ipfs.cf-ipfs.com) - [DWeb](https://${{ needs.annotate.outputs.v1hash }}.ipfs.dweb.link) - [4EVERLAND](https://${{ needs.annotate.outputs.v1hash }}.ipfs.4everland.io) |