Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/cd-teardown.yml

This file was deleted.

136 changes: 0 additions & 136 deletions .github/workflows/cd.yml

This file was deleted.

76 changes: 1 addition & 75 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,91 +8,17 @@ on:
env:
CI: true
jobs:
prepare-deployment:
runs-on: ubuntu-latest
outputs:
deployment-id: ${{ fromJson(steps.create-deployment.outputs.data).id }}
steps:
- name: Create GitHub Deployment
id: create-deployment
uses: octokit/[email protected]
with:
route: POST /repos/:repository/deployments
repository: ${{ github.repository }}
ref: ${{ github.sha }}
environment: review
transient_environment: true
auto_merge: false
mediaType: '{"previews": ["flash", "ant-man"]}'
# The deployment runs in parallel with CI, so status checks will never have succeeded yet:
required_contexts: "[]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

publish-npm:
runs-on: ubuntu-latest
needs: [prepare-deployment]
steps:
- uses: actions/checkout@v3
- name: Mark GitHub Deployment as in progress
id: start-deployment
uses: octokit/[email protected]
with:
route: POST /repos/:repository/deployments/:deployment/statuses
repository: ${{ github.repository }}
deployment: ${{ needs.prepare-deployment.outputs.deployment-id }}
environment: review
description: "Publishing to npm tag [${GITHUB_REF#refs/tags/v}]…"
log_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
state: in_progress
mediaType: '{"previews": ["flash", "ant-man"]}'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Prepare for publication to npm
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
cache: npm
- run: npm ci
- name: Publish to npm
run: |
npm publish --access public
echo "Package published. To install, run:"
echo ""
echo " npm install @inrupt/solid-ui-react"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.INRUPT_NPM_TOKEN }}
- name: Mark GitHub Deployment as successful
uses: octokit/[email protected]
with:
route: POST /repos/:repository/deployments/:deployment/statuses
repository: ${{ github.repository }}
deployment: ${{ needs.prepare-deployment.outputs.deployment-id }}
environment: review
environment_url: "https://www.npmjs.com/package/@inrupt/solid-ui-react/v/${GITHUB_REF#refs/tags/v}"
description: "Published to npm. To install, run: npm install @inrupt/solid-ui-react@${GITHUB_REF#refs/tags/v}"
log_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
mediaType: '{"previews": ["flash", "ant-man"]}'
state: success
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Mark GitHub Deployment as failed
uses: octokit/[email protected]
if: failure()
with:
route: POST /repos/:repository/deployments/:deployment/statuses
repository: ${{ github.repository }}
deployment: ${{ needs.prepare-deployment.outputs.deployment-id }}
environment: review
description: "Publication to npm failed. Review the GitHub Actions log for more information."
log_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
mediaType: '{"previews": ["flash", "ant-man"]}'
state: failure
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Waiting for npm CDNs to update...
run: |
echo "Giving npm some time to make the newly-published package available…"
sleep 5m
echo "Done waiting — hopefully that was enough time for the follow-up jobs to install the just-published package, to verify that everything looks OK."