-
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
Showing
18 changed files
with
603 additions
and
12 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,23 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "01:00" | ||
timezone: "Europe/Berlin" | ||
pull-request-branch-name: | ||
separator: "-" | ||
|
||
# Daily: Check minor and patch updates | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
open-pull-requests-limit: 10 | ||
schedule: | ||
interval: "daily" | ||
time: "01:00" | ||
timezone: "Europe/Berlin" | ||
pull-request-branch-name: | ||
separator: "-" | ||
versioning-strategy: increase |
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,15 @@ | ||
name: Init Workflow | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
init: | ||
name: Init | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⏬ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🔄 Init Cache Default | ||
uses: ./.github/actions/npm-cache |
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: "NPM Cache Action" | ||
description: "Initialize NPM Cache" | ||
inputs: | ||
nodeModulesPath: | ||
description: "Path for node_modules" | ||
required: false | ||
default: "**/node_modules" | ||
packageLockPath: | ||
description: "Path for package-lock.json" | ||
required: false | ||
default: "**/package-lock.json" | ||
nodeVersion: | ||
description: "Node version" | ||
required: false | ||
default: "20" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: 🆙 Setup node | ||
# pick the Node version to use and install it | ||
# https://github.com/actions/setup-node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.nodeVersion }} | ||
|
||
- name: Display node and npm version | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
- name: 🆒 Init Cache | ||
uses: actions/cache@v4 | ||
id: "cache" | ||
with: | ||
path: ${{ inputs.nodeModulesPath }} | ||
key: ${{ runner.os }}-node-${{ inputs.nodeVersion }}-${{ hashFiles(inputs.packageLockPath) }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ inputs.nodeVersion }} | ||
- name: 🎄🎸🥊 Log Cache Hit | ||
shell: bash | ||
env: | ||
HIT: ${{ steps.cache.outputs.cache-hit }} | ||
run: echo $HIT | ||
|
||
- name: ⏬ NPM ci | ||
shell: bash | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
npm ci |
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,45 @@ | ||
--- | ||
name: Upload Figma Plugin/Widget to release page | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
init: | ||
uses: ./.github/workflows/00-init.yml | ||
|
||
publish: | ||
name: Upload Figma Plugin/Widget to release page | ||
runs-on: ubuntu-latest | ||
needs: [init] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: [handover] | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- name: ⏬ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🔄 Init Cache | ||
uses: ./.github/actions/npm-cache | ||
|
||
- name: 🔨 Build Packages | ||
run: npm run build:${{ matrix.package }} | ||
|
||
- name: ⏫ Upload Release Assets | ||
id: upload-release-asset | ||
uses: actions/github-script@v7 | ||
env: | ||
ICON_RELEASE_ID: ${{ vars.ICON_RELEASE_ID }} | ||
with: | ||
result-encoding: json | ||
script: | | ||
const { default: release } = await import('${{ github.workspace }}/.github/scripts/release/index.js'); | ||
const workspace = '${{ github.workspace }}'; | ||
const zipName = '${{ matrix.package }}'; | ||
const srcDir = 'packages/${{ matrix.package }}'; | ||
return await release({github, context, workspace, zipName, srcDir}) |
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 @@ | ||
/* | ||
* Handles full release process for all assets | ||
*/ | ||
|
||
import uploadAsset from "./upload-asset.js"; | ||
import zipFolder from "./zip-folder.js"; | ||
|
||
const release = async ({ github, context, workspace, zipName, srcDir }) => { | ||
const { id: release_id } = context.payload.release; | ||
|
||
// 3. Upload latest icon assets | ||
const destPath = `${workspace}/${srcDir}`; | ||
const assetPath = `${destPath}/${zipName}.zip`; | ||
await zipFolder(destPath, assetPath); | ||
|
||
// 3.1 Upload to current release | ||
await uploadAsset({ | ||
github, | ||
context, | ||
release_id, | ||
assetName: zipName, | ||
assetPath, | ||
}); | ||
}; | ||
|
||
export default release; |
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,42 @@ | ||
/* | ||
* Uploads a file to a release | ||
*/ | ||
import FS from 'node:fs'; | ||
|
||
const uploadAsset = async ({ | ||
github, | ||
context, | ||
release_id, | ||
assetName, | ||
assetPath | ||
}) => { | ||
const { repo, owner } = context.repo; | ||
|
||
const uploadRelease = await github.rest.repos.getRelease({ | ||
owner, | ||
repo, | ||
release_id | ||
}); | ||
|
||
const { assets = [] } = uploadRelease.data; | ||
|
||
const foundAsset = assets?.find((asset) => asset.name === assetName); | ||
|
||
if (foundAsset) { | ||
await github.rest.repos.deleteReleaseAsset({ | ||
owner, | ||
repo, | ||
asset_id: foundAsset.id | ||
}); | ||
} | ||
|
||
return await github.rest.repos.uploadReleaseAsset({ | ||
owner, | ||
repo, | ||
release_id, | ||
name: assetName, | ||
data: FS.readFileSync(assetPath) | ||
}); | ||
}; | ||
|
||
export default uploadAsset; |
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,12 @@ | ||
/* Zips a complete folder */ | ||
|
||
import AdmZip from "adm-zip"; | ||
|
||
const zipFolder = async (destPath, assetPath) => { | ||
const zip = new AdmZip(); | ||
zip.addLocalFolder(`${destPath}/dist`); | ||
zip.addLocalFile(`${destPath}/manifest.json`); | ||
return zip.writeZipPromise(assetPath); | ||
}; | ||
|
||
export default zipFolder; |
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,132 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, caste, color, religion, or sexual | ||
identity and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
- Demonstrating empathy and kindness toward other people | ||
- Being respectful of differing opinions, viewpoints, and experiences | ||
- Giving and gracefully accepting constructive feedback | ||
- Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
- Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
- The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
- Trolling, insulting or derogatory comments, and personal or political attacks | ||
- Public or private harassment | ||
- Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
- Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official email address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[[email protected]](mailto:[email protected]). | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining | ||
the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed | ||
unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing | ||
clarity around the nature of the violation and an explanation of why the | ||
behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series of | ||
actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No | ||
interaction with the people involved, including unsolicited interaction with | ||
those enforcing the Code of Conduct, for a specified period of time. This | ||
includes avoiding interactions in community spaces as well as external channels | ||
like social media. Violating these terms may lead to a temporary or permanent | ||
ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including | ||
sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public | ||
communication with the community for a specified period of time. No public or | ||
private interaction with the people involved, including unsolicited interaction | ||
with those enforcing the Code of Conduct, is allowed during this period. | ||
Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community | ||
standards, including sustained inappropriate behavior, harassment of an | ||
individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within the | ||
community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.1, available at | ||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
||
Community Impact Guidelines were inspired by | ||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at | ||
[https://www.contributor-covenant.org/translations][translations]. | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
[Mozilla CoC]: https://github.com/mozilla/diversity | ||
[FAQ]: https://www.contributor-covenant.org/faq | ||
[translations]: https://www.contributor-covenant.org/translations |
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,3 @@ | ||
# Global Repository owners | ||
# see https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners for details of syntax | ||
* [email protected] [email protected] [email protected] |
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,15 @@ | ||
# Contributing | ||
|
||
Thanks for your interest in our project. Contributions are welcome. Feel free to [open an issue](https://github.com/db-ui/figma-hub/issues/new) with questions or reporting ideas and bugs, or [open pull requests](https://github.com/db-ui/figma-hub/compare) to contribute code. | ||
|
||
We are committed to fostering a welcoming, respectful, and harassment-free environment. Be kind! | ||
|
||
## Before you commit | ||
|
||
Please make sure that husky is installed correctly to validate your changes. | ||
|
||
Moreover, you need to duplicate `.env.template` as `.env` and type your own email address. This ensures that you have the correct email set for this project. | ||
|
||
### Conventions | ||
|
||
Please be aware that we have some [code and git commit (message and branch naming) conventions](docs/conventions.md), that we ensure with some linting tools. |
Oops, something went wrong.