-
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
1 parent
aed64a3
commit a782481
Showing
13 changed files
with
2,855 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,5 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# global owners will be requested for | ||
# review when someone opens a pull request. | ||
* @kyubisation @jeripeierSBB @mcilurzo |
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: 'Create release' | ||
description: 'Creates a release, publishes the package and pushes icons to S3' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: 'Release: Create release with standard-version' | ||
run: | | ||
if [ -f CHANGELOG.md ]; then | ||
yarn standard-version | ||
else | ||
yarn standard-version --first-release | ||
fi | ||
shell: bash | ||
- name: 'Release: Push release to repository' | ||
run: git push --follow-tags origin master | ||
shell: bash | ||
- name: 'Release: Determine npm tag' | ||
id: npm_tag | ||
run: | | ||
if [[ "$REF" == *"-"* ]] | ||
then | ||
echo "::set-output name=npm_tag::next" | ||
else | ||
echo "::set-output name=npm_tag::latest" | ||
fi | ||
env: | ||
REF: ${{ github.ref }} | ||
shell: bash | ||
- name: 'Release: Publish @sbb-esta/icons' | ||
run: yarn publish --tag ${{ steps.npm_tag.outputs.npm_tag }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
shell: bash | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.ICON_CDN_AWS_ACCESS_ID }} | ||
aws-secret-access-key: ${{ secrets.ICON_CDN_AWS_ACCESS_KEY }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
env: | ||
AWS_REGION: eu-central-1 | ||
- name: Upload icons and indexes to s3 | ||
run: aws s3 cp . s3://${{ env.S3BUCKET }} --recursive --exclude "node_modules/*" --include "*.svg" --include index.json | ||
env: | ||
S3BUCKET: cloudfront-icon-cdn-backend-esta-web-prod | ||
shell: bash |
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,22 @@ | ||
name: 'Installing Yarn dependencies' | ||
description: 'Installs the dependencies using Yarn' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: 'Yarn: Get cache directory path' | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
shell: bash | ||
- name: 'Yarn: Restore dependencies from cache' | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
# Cache key. Whenever the something of significance changes (e.g. postinstall), the cache needs to be invalidated. | ||
# If just the `yarn.lock` file changes, the most recent cache can be restored though. | ||
# See: https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action. | ||
key: ${{ runner.os }}-yarn-v1-${{hashFiles('yarn.lock')}} | ||
restore-keys: ${{ runner.os }}-yarn-v1- | ||
- name: 'Yarn: Install dependencies' | ||
run: yarn install --frozen-lockfile --non-interactive | ||
shell: bash |
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,40 @@ | ||
name: Release | ||
|
||
on: | ||
repository_dispatch: | ||
types: [LIBRARY_PUBLISH] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://registry.npmjs.org' | ||
scope: sbb-esta | ||
- name: Yarn Install | ||
uses: ./.github/actions/yarn-install | ||
|
||
- name: 'Release: Set git user' | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
- name: Extract icons | ||
run: yarn extract | ||
env: | ||
FIGMA_FILE_ID: ${{ secrets.FIGMA_FILE_ID }} | ||
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Commit changes | ||
run: | | ||
git add --all | ||
git commit -m "$MESSAGE" | ||
env: | ||
MESSAGE: ${{ github.event.client_payload.description }} | ||
|
||
- name: Release | ||
uses: ./.github/actions/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,31 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'push' && | ||
github.event.workflow_run.conclusion == 'success' && | ||
( | ||
startsWith(github.event.workflow_run.head_commit.message, 'feat') || | ||
startsWith(github.event.workflow_run.head_commit.message, 'fix') || | ||
startsWith(github.event.workflow_run.head_commit.message, 'refactor') | ||
) | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://registry.npmjs.org' | ||
scope: sbb-esta | ||
- name: Yarn Install | ||
uses: ./.github/actions/yarn-install | ||
- name: 'Release: Set git user' | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
- name: Release | ||
uses: ./.github/actions/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
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 @@ | ||
18.4.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,28 @@ | ||
{ | ||
"name": "@sbb-esta/icons", | ||
"version": "0.1.0", | ||
"description": "Icon package for the SBB organization", | ||
"repository": "https://github.com/sbb-design-systems/sbb-icons.git", | ||
"author": "ESTA", | ||
"license": "Apache-2.0", | ||
"keywords": ["icons", "svg", "sbb"], | ||
"scripts": { | ||
"extract": "tsx scripts/extract-icons.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "18.0.3", | ||
"@types/svgo": "2.6.3", | ||
"figma-js": "1.15.0", | ||
"node-fetch": "3.2.6", | ||
"octokit": "2.0.3", | ||
"standard-version": "9.5.0", | ||
"svgo": "2.8.0", | ||
"tsx": "3.7.1", | ||
"typescript": "4.7.4" | ||
}, | ||
"files": ["icons"], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"type": "module" | ||
} |
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,27 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": ["config:base"], | ||
"nodenv": { | ||
"enabled": false | ||
}, | ||
"lockFileMaintenance": { | ||
"schedule": ["before 7am on monday"], | ||
"enabled": true | ||
}, | ||
"packageRules": [ | ||
{ | ||
"matchUpdateTypes": ["minor", "patch", "pin", "digest", "lockFileMaintenance", "bump"], | ||
"automerge": true, | ||
"automergeType": "branch", | ||
"automergeStrategy": "squash" | ||
}, | ||
{ | ||
"groupName": "eslint", | ||
"matchPackagePrefixes": ["@typescript-eslint/", "eslint", "vue-eslint"] | ||
}, | ||
{ | ||
"groupName": "commitlint", | ||
"matchPackagePrefixes": ["@commitlint/", "standard-version"] | ||
} | ||
] | ||
} |
Oops, something went wrong.