-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): allow triggering nightly build for PRs
- Loading branch information
Showing
5 changed files
with
129 additions
and
29 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Nightly Release | ||
description: Automatically release nightly builds | ||
|
||
inputs: | ||
checkout-repo: | ||
description: 'Repository to checkout' | ||
required: true | ||
checkout-ref: | ||
description: 'Ref to checkout' | ||
required: true | ||
release-branch: | ||
description: 'Branch name' | ||
required: true | ||
release-id: | ||
description: 'Release ID' | ||
required: true | ||
npm-tag: | ||
description: 'NPM tag' | ||
required: true | ||
npm-token: | ||
description: 'NPM token' | ||
required: true | ||
|
||
outputs: | ||
full-version: | ||
description: 'Full version' | ||
value: ${{ env.FULL_VERSION }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
git config --global user.email "actions@github.com" | ||
git config --global user.name "GitHub Actions" | ||
shell: bash | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ inputs.checkout-repo }} | ||
ref: ${{ inputs.checkout-ref }} | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/yarn-install | ||
- run: >- | ||
node -e " | ||
const json = require('./lerna.json'); | ||
delete json.command.publish.allowBranch; | ||
fs.writeFileSync('./lerna.json', JSON.stringify(json, null, 2))" | ||
shell: bash | ||
- run: echo "FULL_VERSION=$(node -e "console.log(require('./lerna.json').version)")-${{ inputs.release-branch }}.${{ inputs.release-id }}" >> $GITHUB_ENV | ||
shell: bash | ||
- run: yarn lerna version $FULL_VERSION --no-push --no-commit-hooks --force-publish --yes | ||
shell: bash | ||
- run: yarn conventional-changelog -p angular --outfile ./packages/vuetify/CHANGELOG.md -r 2 | ||
shell: bash | ||
- run: >- | ||
node -e "fs.writeFileSync( | ||
'./package.json', | ||
JSON.stringify({ ...require('./package.json'), name: '@vuetify/nightly' }, null, 2) | ||
)" | ||
shell: bash | ||
working-directory: ./packages/vuetify | ||
- run: yarn lerna run build --scope @vuetify/nightly | ||
shell: bash | ||
- run: yarn lerna run build --scope @vuetify/api-generator | ||
shell: bash | ||
- name: NPM Release | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken ${NPM_API_KEY:?} | ||
npm publish ./packages/vuetify --tag ${{ inputs.npm-tag }} --access public | ||
shell: bash | ||
env: | ||
NPM_API_KEY: ${{ inputs.npm-token }} |
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Nightly Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: 'Pull Request number' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository_owner == 'vuetifyjs' }} | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const pr = await github.rest.pulls.get({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: ${{ github.event.inputs.pr }} | ||
}) | ||
core.exportVariable('CHECKOUT_REPO', pr.data.head.repo.full_name) | ||
core.exportVariable('CHECKOUT_REF', pr.data.head.ref) | ||
core.exportVariable('RELEASE_ID', pr.data.head.sha.slice(0, 7)) | ||
- id: nightly-release | ||
uses: ./.github/actions/nightly-release | ||
with: | ||
checkout-repo: ${{ env.CHECKOUT_REPO }} | ||
checkout-ref: ${{ env.CHECKOUT_REF }} | ||
release-branch: pr-${{ github.event.inputs.pr }} | ||
release-id: ${{ env.RELEASE_ID }} | ||
npm-tag: pr | ||
npm-token: ${{ secrets.NPM_TOKEN }} | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const fullVersion = process.env.FULL_VERSION | ||
const pr = await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: ${{ github.event.inputs.pr }}, | ||
body: `:rocket: Nightly release published to [@vuetify/nightly@${fullVersion}](https://www.npmjs.com/package/@vuetify/nightly/v/${fullVersion}).` | ||
}) | ||
env: | ||
FULL_VERSION: ${{ steps.nightly-release.outputs.full-version }} |
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
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