Skip to content

Commit

Permalink
chore: setup workflows, add issue templates
Browse files Browse the repository at this point in the history
  • Loading branch information
MillerSvt committed Apr 2, 2024
1 parent b4c7204 commit 71042f7
Show file tree
Hide file tree
Showing 12 changed files with 3,175 additions and 369 deletions.
82 changes: 82 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: '🐞 - Bug Report'
title: '🐞 - '
description: Report a bug in the Maskito
labels: ['bug']

body:
- type: dropdown
id: affected-packages
attributes:
label: Which package(s) are the source of the bug?
options:
- '@maskito/core'
- '@maskito/kit'
- '@maskito/phone'
- '@maskito/angular'
- '@maskito/react'
- '@maskito/vue'
- Don't known / other
multiple: true
validations:
required: true

- type: input
id: playground-link
attributes:
label: Playground Link
description: |
Link to an isolated reproduction in our [StackBlitz playground](https://maskito.dev/stackblitz).
If either of the following holds true:
- You can't reproduce the issue in the playground
- Your issue requires some complex setup - such as multiple files or a specific folder structure.
So you can use any link that might help for reproduction bug: github repo, demo url, etc.
***Help us to help you!***
placeholder: https://stackblitz.com/edit/...
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
placeholder: |
Please provide the exception or error you saw.
How do you trigger this bug?
Please walk us through it step by step.
Please provide a screenshot if possible.
validations:
required: true

- type: input
id: maskito-version
attributes:
label: Maskito version
placeholder: x.y.z
validations:
required: true

- type: checkboxes
id: browser-specific
attributes:
label: Which browsers have you used?
description: You may select more than one.
options:
- label: Chrome
- label: Firefox
- label: Safari
- label: Edge

- type: checkboxes
id: operating-systems
attributes:
label: Which operating systems have you used?
description: You may select more than one.
options:
- label: macOS
- label: Windows
- label: Linux
- label: iOS
- label: Android
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: '🚀 - Feature Request'
title: '🚀 - '
description: Suggest a feature for Maskito
labels: ['feature']

body:
- type: dropdown
id: affected-packages
attributes:
label: Which package(s) are relevant/related to the feature request?
options:
- '@maskito/core'
- '@maskito/kit'
- '@maskito/phone'
- '@maskito/angular'
- '@maskito/react'
- '@maskito/vue'
- Don't known / other
multiple: true

- type: textarea
id: description
attributes:
label: Description
placeholder: |
Proposed solution.
Alternatives considered.
validations:
required: true
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/3-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: '📚 - Documentation'
title: '📚 - '
description: Report an issue in Maskito's documentation
labels: ['documentation']

body:
- type: input
id: affected-url
attributes:
label: What is the affected URL?

- type: textarea
id: description
attributes:
label: Description
placeholder: |
How do you trigger this bug?
Please walk us through it step by step.
Please provide a screenshot if possible.
validations:
required: true

- type: checkboxes
id: browser-specific
attributes:
label: Which browsers have you used?
description: You may select more than one.
options:
- label: Chrome
- label: Firefox
- label: Safari
- label: Edge

- type: checkboxes
id: operating-systems
attributes:
label: Which operating systems have you used?
description: You may select more than one.
options:
- label: macOS
- label: Windows
- label: Linux
- label: iOS
- label: Android
101 changes: 101 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Create release

on:
workflow_dispatch:
inputs:
mode:
type: choice
description: release type
required: true
default: 'minor'
options:
- patch
- minor
- prerelease
- major
dryRun:
type: boolean
required: false
description: --dry-run

jobs:
run-release:
name: Run release
runs-on: ubuntu-latest
env:
IS_DRY_MODE: ${{ github.event.inputs.dryRun == 'true' }}
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
with:
fetch-depth: 0
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/config/[email protected]
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}

- name: Run release
id: run-release
run: |
npm run release -- \
--release-as ${{ github.event.inputs.mode }} \
--dry-run ${{ github.event.inputs.dryRun }}
echo "new_version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Generate Release Body
id: generate_body
run: |
npx extract-changelog-release > RELEASE_BODY.md
echo "tag_name=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
- id: get-pr-body
run: |
body=$(cat RELEASE_BODY.md)
delimiter="$(openssl rand -hex 8)"
echo "body<<$delimiter" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "$delimiter" >> $GITHUB_OUTPUT
- name: Debug body of pull request in dry mode
if: ${{ env.IS_DRY_MODE == 'true' }}
run: echo "${{ steps.get-pr-body.outputs.body }}"

- name: Debug variables
if: ${{ env.IS_DRY_MODE == 'true' }}
run: |
echo "${{ steps.generate_body.outputs.tag_name }}"
echo "release/${{ steps.run-release.outputs.new_version }}"
echo "${{ steps.get-pr-body.outputs.body }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
if: ${{ env.IS_DRY_MODE == 'false' }}
with:
delete-branch: true
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}
branch: release/${{ steps.run-release.outputs.new_version }}
title: '🚀 Release/v${{ steps.run-release.outputs.new_version }}'
body: |
${{ steps.get-pr-body.outputs.body }}
---
> **DO NOT SQUASH OR REBASE ME**
> if user merges this PR via rebasing or using squash, it will cause lost of the tag. It happens because tag is already
> attached to the initial release commit SHA. If we use rebase or squash, the commit sha changes and already created tag
> points to not-existing commit.
- name: Create GitHub Release
if: ${{ env.IS_DRY_MODE == 'false' }}
uses: ncipollo/[email protected]
with:
name: Release ${{ steps.generate_body.outputs.tag_name }}
tag: ${{ steps.generate_body.outputs.tag_name }}
bodyFile: 'RELEASE_BODY.md'
token: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: create-release-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint
on: [pull_request]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run lint ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --fix' || '' }}
- uses: taiga-family/ci/actions/auto/[email protected]
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}

concurrency:
group: lint-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
34 changes: 34 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
push:
branches: ['release/*']

jobs:
publish:
name: Publish
runs-on: ubuntu-latest

steps:
- uses: taiga-family/ci/actions/setup/[email protected]
with:
fetch-depth: 0
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/config/[email protected]
with:
token: ${{ secrets.TAIGA_UI_SCOPE_NPM_TOKEN }}

- name: Build
run: npm run build

- name: Publish
run: npm publish

- name: Get new version
id: info
run: echo "version=v$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

concurrency:
group: release-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
pull_request:
push:
branches:
- main

jobs:
tests:
if: ${{ !contains(github.head_ref, 'release/') }}
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]

- name: Run tests
run: npm test

concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.idea
dist
dist
RELEASE_BODY.md
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
npm run lint
npm run lint -- --fix
npm test
Empty file added CHANGELOG.md
Empty file.
Loading

0 comments on commit 71042f7

Please sign in to comment.