Skip to content

Commit

Permalink
Merge pull request #8 from tiavina-mika/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tiavina-mika committed Apr 29, 2024
2 parents 7f6fdd1 + a9e1837 commit 1a5f80c
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
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

0 comments on commit 1a5f80c

Please sign in to comment.