-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): refactor release and dependabot
- Loading branch information
Showing
5 changed files
with
244 additions
and
179 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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
name: 'build-test' | ||
on: | ||
push: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
tags: | ||
- '*' | ||
pull_request: | ||
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target for security implications. | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
|
@@ -23,7 +21,6 @@ jobs: | |
- name: Get info | ||
id: info | ||
run: | | ||
echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} | ||
echo ::set-output name=repo_name::$(echo $GITHUB_REPOSITORY| cut -d / -f 2) | ||
echo ::set-output name=repo_owner::$(echo $GITHUB_REPOSITORY| cut -d / -f 1) | ||
|
@@ -53,21 +50,3 @@ jobs: | |
args: > | ||
-Dsonar.organization=${{ steps.info.outputs.repo_owner }} | ||
-Dsonar.projectKey=${{ steps.info.outputs.repo_name }} | ||
- name: Get installation token | ||
if: github.event_name != 'pull_request' && contains('refs/heads/main', github.ref) && matrix.node-version == 14 | ||
uses: npalm/[email protected] | ||
id: app-token | ||
with: | ||
appId: ${{ secrets.APP_ID }} | ||
appPrivateKeyBase64: ${{ secrets.APP_PRIVATE_KEY_BASE64 }} | ||
appInstallationType: repo | ||
appInstallationValue: ${{ github.repository }} | ||
|
||
- name: Release | ||
if: github.event_name != 'pull_request' && contains('refs/heads/main', github.ref) && matrix.node-version == 14 | ||
env: | ||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn release --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git |
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,44 @@ | ||
name: 'Release' | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
options: | ||
description: "Extra options for running a release, e.g. -d for a dry run" | ||
default: '' | ||
required: false | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Run checks | ||
run: yarn run test && yarn lint && yarn run build | ||
|
||
- name: Get installation token | ||
uses: npalm/[email protected] | ||
id: app-token | ||
with: | ||
appId: ${{ secrets.APP_ID }} | ||
appPrivateKeyBase64: ${{ secrets.APP_PRIVATE_KEY_BASE64 }} | ||
appInstallationType: repo | ||
appInstallationValue: ${{ github.repository }} | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn release ${{ github.event.inputs.options }} --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git |
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
Oops, something went wrong.