Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #8

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Publish Package to npmjs
run-name: ${{ github.actor }} publish to npm 🚀

on:
push:
tags:
- "v*.*.*"
jobs:
# Then release to npm
build:
name: Lint and build
runs-on: ubuntu-latest

# needs: [build-test] # Require standard CI steps to pass before publishing

steps:
- name: Checkout repo
uses: actions/checkout@v4

# Set up .npmrc file to publish to npm. This also allows NODE_AUTH_TOKEN
# to work below.
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

- name: Setup Yarn in Node
uses: actions/setup-node@v4
with:
cache: "yarn" # uses the system node, which was updated prior.

- name: Install dependencies
run: yarn

- name: Lint and clean code
run: yarn lint

- name: Build
run: yarn build

# Then release to npm
release:
if: ${{ github.ref == 'refs/heads/main' }}
name: Publish
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write # Needed for https://docs.npmjs.com/generating-provenance-statements
strategy:
matrix:
node-version: [18]


needs: [build] # Require standard CI steps to pass before publishing

steps:
# - name: Checkout repo
# run: echo "${{ github.event_name }} on ${{ github.ref }}."

- name: Checkout repo
uses: actions/checkout@v4

# Set up .npmrc file to publish to npm. This also allows NODE_AUTH_TOKEN
# to work below.
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

# - name: Setup Yarn in Node
# uses: actions/setup-node@v4
# with:
# cache: "yarn" # uses the system node, which was updated prior.

- name: yarn publish --provenance
# - run: yarn publish --provenance
uses: ./
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"email": "[email protected]",
"github": "https://github.com/tiavina-mika"
},
"version": "0.1.36",
"version": "0.1.4",
"license": "MIT",
"type": "module",
"types": "./dist/index.d.ts",
Expand Down