Skip to content

Commit

Permalink
chore: setup check and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhankiyar committed Jan 8, 2024
1 parent ed9b197 commit d83abf9
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build & Test

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-20.04
name: Build & Test

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup
uses: actions/setup-node@v3
with:
node-version: 16

- name: Build
env:
VERSION: 1.0.0
run: |
bash ./scripts/build.sh
- name: Test
run: |
bash ./scripts/test.sh
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build & Release

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-20.04
name: Build & Release
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get version
id: vars
run: |
bash ./scripts/version.sh
echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
- name: Build
env:
VERSION: ${{ steps.vars.outputs.version }}
run: |
bash ./scripts/build.sh
- name: Test
run: |
bash ./scripts/test.sh
- name: Create release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.vars.outputs.version }}"
release_name: "v${{ steps.vars.outputs.version }}"
draft: false
prerelease: false

- name: Pack
env:
REGISTRY_SOURCE: registry.npmjs.org
REGISTRY_KEY: ${{ secrets.NPM_TOKEN }}
run: |
bash ./scripts/pack.sh

0 comments on commit d83abf9

Please sign in to comment.