-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
375 additions
and
91 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
name: Build package | ||
description: Build the SDK package | ||
|
||
inputs: | ||
node: | ||
description: The Node version to use | ||
required: false | ||
default: 18 | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node }} | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: npm ci --include=dev | ||
|
||
- name: Build package | ||
shell: bash | ||
run: npm run build |
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,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,95 @@ | ||
name: Publish Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' # Release versions | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' # Beta versions | ||
- '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
env: | ||
NODE_VERSION: 18 | ||
CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}' | ||
|
||
jobs: | ||
build: | ||
name: Build Package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build package | ||
uses: ./.github/actions/build | ||
with: | ||
node: ${{ env.NODE_VERSION }} | ||
|
||
- name: Save build artifacts | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: . | ||
key: ${{ env.CACHE_KEY }} | ||
|
||
publish-npm: | ||
needs: build # Don't publish to NPM until the package is successfully built | ||
|
||
name: 'NPM' | ||
runs-on: ubuntu-latest | ||
environment: release | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: npm | ||
|
||
- name: Restore build artifacts | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: . | ||
key: ${{ env.CACHE_KEY }} | ||
|
||
- name: Publish release to NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
publish-gh: | ||
needs: publish-npm # Don't publish to GitHub Packages until publishing to NPM is successfully completed | ||
|
||
name: 'GitHub Packages' | ||
runs-on: ubuntu-latest | ||
environment: release | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
registry-url: 'https://npm.pkg.github.com' | ||
cache: npm | ||
|
||
- name: Restore build artifacts | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: . | ||
key: ${{ env.CACHE_KEY }} | ||
|
||
- name: Publish release to GitHub Packages | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_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,48 @@ | ||
name: Snyk | ||
|
||
on: | ||
merge_group: | ||
workflow_dispatch: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
push: | ||
branches: | ||
- master | ||
- beta | ||
schedule: | ||
- cron: '30 0 1,15 * *' | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | ||
|
||
jobs: | ||
authorize: | ||
name: Authorize | ||
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: true | ||
|
||
check: | ||
needs: authorize | ||
|
||
name: Check for Vulnerabilities | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group' | ||
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection. | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||
|
||
- uses: snyk/actions/php@b98d498629f1c368650224d6d212bf7dfa89e4bf # [email protected] | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |
Oops, something went wrong.