-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit b5ae7ba
Showing
12 changed files
with
68,107 additions
and
0 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,52 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Compile TypeScript | ||
run: npx tsc | ||
|
||
- name: Bundle with ncc | ||
run: | | ||
npm run build | ||
- name: Get release ID | ||
id: get_release | ||
uses: actions/github-script@v4 | ||
with: | ||
script: | | ||
const release = await github.repos.getReleaseByTag({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag: context.ref.replace('refs/tags/', '') | ||
}); | ||
return release.data.id; | ||
result-encoding: string | ||
|
||
- name: Upload release asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_release.outputs.result }}/assets?name=index.js | ||
asset_path: ./dist/index.js | ||
asset_name: index.js | ||
asset_content_type: application/javascript | ||
|
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,16 @@ | ||
name: Test Action | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Meshstack Authentication | ||
id: setup-meshstack-auth | ||
uses: ./ | ||
with: | ||
base_url: https://federation.dev.meshcloud.io | ||
client_id: ${{ secrets.CLIENT_ID }} | ||
key_secret: ${{ secrets.KEY_SECRET }} |
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,49 @@ | ||
# Node.js | ||
node_modules/ | ||
build/ | ||
|
||
# TypeScript | ||
*.tsbuildinfo | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Dependency directories | ||
jspm_packages/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# MacOS files | ||
.DS_Store | ||
|
||
# Editor directories and files | ||
.vscode/ | ||
.idea/ | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
#testing secret | ||
.secrets |
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,35 @@ | ||
# MeshStack Auth Action | ||
|
||
This action authenticates to meshStack API. | ||
|
||
### Overview | ||
|
||
This GitHub Action is designed to authenticate against the Meshfed API. It helps you obtain an access token using client credentials, which can then be used to interact with the Meshfed API securely. This action simplifies the process of obtaining and managing authentication tokens for your workflows. | ||
|
||
### API Documentation | ||
|
||
For more information about the Meshfed API, please refer to the [Meshfed API Documentation](https://docs.meshcloud.io/api/index.html). | ||
|
||
|
||
### Inputs | ||
|
||
- `base_url` (required): meshStack API endpoint. | ||
- `client_id` (required): The client ID for the API. | ||
- `key_secret` (required): The key secret for the API. | ||
|
||
### Outputs | ||
|
||
- `token_file`: Path to the file containing the authentication token | ||
|
||
|
||
### Example Usage | ||
|
||
```yaml | ||
- name: Setup meshStack bbrun | ||
id: setup-meshstack-auth | ||
uses: meshcloud/actions-register-source@main | ||
with: | ||
base_url: ${{ vars.BUILDINGBLOCK_API_BASE_URL }} | ||
client_id: ${{ vars.BUILDINGBLOCK_API_CLIENT_ID }} | ||
key_secret: ${{ secrets.BUILDINGBLOCK_API_KEY_SECRET }} | ||
``` |
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,24 @@ | ||
name: 'Setup Meshstack Authentication' | ||
description: 'Authenticates with Meshstack and sets up environment variables' | ||
inputs: | ||
base_url: | ||
description: 'The URL of the Meshstack instance' | ||
required: true | ||
type: string | ||
client_id: | ||
description: 'The client ID for authentication' | ||
required: true | ||
type: string | ||
key_secret: | ||
description: 'The key secret for authentication' | ||
required: true | ||
type: string | ||
outputs: | ||
token_file: | ||
description: 'Path to the file containing the authentication token' | ||
runs: | ||
using: 'node20' | ||
main: 'dist/main/index.js' | ||
post: 'dist/cleanup/index.js' | ||
|
||
|
Oops, something went wrong.