Skip to content

Commit

Permalink
feat(ci): release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Mar 15, 2024
1 parent 042c93f commit 06271b5
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ jobs:
CLUSTER_USER: ${{ secrets.CLUSTER_USER }}
CLUSTER_PASSWORD: ${{ secrets.CLUSTER_PASSWORD }}
timeout-minutes: 60
- name: Attach the CAR to release if building a release tag
if: github.event_name == 'release' && github.event.action == 'published'
run: |
curl \
-XPOST \
-H "Authorization: Bearer ${{ secrets.UCI_GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@dist_${{ github.sha }}.car" \
"https://api.github.com/repos/${{ github.repository }}/releases/${{ steps.get_release.outputs.release_id }}/assets?name=dist_${{ github.event.release.tag_name }}_${{ github.sha }}.car"
- name: Update DNSLink at inbrowser.dev (Staging for Dev Testing) if main branch was updated
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
run: |
Expand Down Expand Up @@ -366,7 +375,7 @@ jobs:
- cloudflare-ipfs.com
steps:
- name: Try fetching the new CID as CAR from ${{ matrix.gateway }}
run: curl --retry 6 --retry-delay 61 --retry-all-errors -v -L "https://${{ matrix.gateway }}/ipfs/${{ needs.publish-to-ipfs.outputs.cid }}?format=car" -o dag.car
run: curl --retry 6 --retry-delay 61 --retry-all-errors -v -L --http1.1 "https://${{ matrix.gateway }}/ipfs/${{ needs.publish-to-ipfs.outputs.cid }}?format=car" -o dag.car
- uses: ipfs/download-ipfs-distribution-action@v1
with:
name: kubo
Expand Down Expand Up @@ -396,3 +405,19 @@ jobs:
- uses: ipfs/start-ipfs-daemon-action@v1
- name: Confirm Kubo can fetch with Routing.Type=${{ matrix.routing-type }}
run: ipfs dag stat ${{ needs.publish-to-ipfs.outputs.cid }}

release-please:
runs-on: ubuntu-latest
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
needs: [ build, check ]
permissions:
contents: write # to create release
pull-requests: write # to create release PR
steps:
- uses: google-github-actions/release-please-action@v4
with:
# NOTE: we need elevated PAT token for production DNSLink to be updated. this is because tags created by the default token
# will not trigger CI build, and we need publish-to-ipfs to run when a new release tag is created by this action
# https://github.com/google-github-actions/release-please-action?tab=readme-ov-file#github-credentials
token: ${{ secrets.UCI_GITHUB_TOKEN || github.token }}
release-type: node

0 comments on commit 06271b5

Please sign in to comment.