Skip to content

Commit

Permalink
ci: update release configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
r17x committed Aug 20, 2024
1 parent c9a8072 commit bfa5f62
Show file tree
Hide file tree
Showing 9 changed files with 1,405 additions and 4,297 deletions.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
- Nodejs Version

**Smartphone (please complete the following information):**

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
- Nodejs Version

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
37 changes: 37 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Setup

description: Setup Node.js, cache and install dependencies (using yarn specificly)

inputs:
node_version:
description: Node.js version
required: false
default: "20"
rust_cache_enable:
description: enable actions/cache@v3 for rust
required: false
default: "false"

runs:
using: composite
steps:
- name: Checkout all commits
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup git user to "anakmagang"
shell: bash
run: |
git config user.email "[email protected]"
git config user.name "anakmagang"
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ inputs.node_version }}

- name: yarn install
shell: bash
run: yarn install --immutable
5 changes: 2 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ updates:
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: npm
directory: /
- directory: /
assignees:
- "r17x"
open-pull-requests-limit: 5
package-ecosystem: npm
rebase-strategy: auto
schedule:
interval: daily
Expand Down
113 changes: 49 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,69 @@
name: Publish

name: release
on:
push:
branches:
- "[12].[0-9x]+.[0-9x]+"
- main
- next
- alpha
- beta

pull_request:
branches:
- main
- next
jobs:
tests:
name: Test or Build
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- id: vars
name: Find Yarn's cache folder
run: |
echo "::set-output name=path::$(yarn config get cacheFolder)"
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
- name: Cache node modules
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.vars.outputs.path }}
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
- name: Install dependencies
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
- uses: ./.github/actions/setup
- uses: wagoid/commitlint-github-action@v6
env:
CI: true
run: |
yarn install
yarn ci
NODE_PATH: ${{ github.workspace }}/node_modules

- name: Build
run: yarn run build
run: yarn build

- name: Test
env:
CI: true
run: yarn run test --coverage
run: yarn test

publish:
needs: tests
name: Publish to Github & NPM or Github Package Registry
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
- id: vars
name: Find Yarn's cache folder
run: |
echo "::set-output name=path::$(yarn config get cacheFolder)"
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
- name: Cache node modules
uses: actions/cache@v4
id: yarn-cache
- uses: ./.github/actions/setup
- name: Build
run: yarn build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
path: ${{ steps.vars.outputs.path }}
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
- name: Install dependencies
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
env:
CI: true
run: |
yarn install
yarn ci
- if: success()
semantic_version: 19.0.2
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
@semrel-extra/npm
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_COMMITTER_EMAIL: "[email protected]"
GIT_AUTHOR_NAME: "anakmagang"
GIT_COMMITTER_NAME: "anakmagang"
78 changes: 0 additions & 78 deletions .github/workflows/test.release.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version = 1

[approve]
auto_approve_usernames = ["dependabot"]

[merge]
method = "rebase_fast_forward"
prioritize_ready_to_merge = true

[merge.automerge_dependencies]
usernames = ["dependabot"]
versions = ["minor", "patch"]

[merge.message]
body = "pull_request_body"
body_type = "markdown"
include_pr_number = true
strip_html_comments = true
title = "pull_request_title"

[update]
always = true
ignored_usernames = ["dependabot"]
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"src/**/*.rei",
"src/**/*.res",
"src/**/*.resi",
"bsconfig.json"
"rescript.json"
],
"repository": "https://github.com/rescript-ui/rescript-chakra",
"bugs": "https://github.com/rescript-ui/rescript-chakra/issues",
"packageManager": "[email protected]",
"scripts": {
"start": "rescript build -w",
"prebuild": "rescript clean",
"build": "rescript build -with-deps",
"clean": "rescript clean",
"semantic-release": "semantic-release",
"ci": "yarn install --immutable",
"pretest": "yarn build",
"test": "vitest run",
Expand All @@ -53,6 +53,9 @@
"@emotion/react": "11.4.1",
"@emotion/styled": "11.3.0",
"@rescript/react": "0.13.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "10.0.1",
"@semrel-extra/npm": "1.2.0",
"@vitest/coverage-v8": "^2.0.5",
"framer-motion": "4.1.17",
"husky": "7.0.2",
Expand All @@ -63,8 +66,7 @@
"react-dom": "17.0.2",
"rescript": "^11",
"rescript-vitest": "^1.4.0",
"semantic-release": "17.4.4",
"semantic-release-npm-github-publish": "1.4.0",
"semantic-release": "19.0.2",
"vitest": "^2.0.5"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit bfa5f62

Please sign in to comment.