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 4566765
Show file tree
Hide file tree
Showing 9 changed files with 1,428 additions and 4,296 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.
57 changes: 57 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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: rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: wasm32-wasi

- name: yarn install
shell: bash
run: yarn --frozen-lockfile --no-progress --non-interactive --prefer-offline || yarn install --check-cache

- uses: actions/cache@v3
id: "rust_cache_hits"
if: ${{ inputs.rust_cache_enable }}
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
/usr/share/rust/.rustup
**/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
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
116 changes: 52 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,72 @@
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: validate (lint)
run: yarn lint

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

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

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

publish:
needs: tests
name: Publish to Github & NPM or Github Package Registry
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"]
Loading

0 comments on commit 4566765

Please sign in to comment.