Skip to content

Commit

Permalink
Ci cd (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ve authored Oct 4, 2023
1 parent 5ba37d8 commit 6b95391
Show file tree
Hide file tree
Showing 18 changed files with 504 additions and 1,380 deletions.
64 changes: 0 additions & 64 deletions .eslintrc-auto-import.json

This file was deleted.

49 changes: 0 additions & 49 deletions .eslintrc.js

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is a basic workflow that is manually triggered

name: ⬆️ Bump version

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version:
# Friendly description to be shown in the UI instead of 'name'
description: 'Semver type of new version (major / minor / patch)'

required: true
type: choice
options:
- patch
- minor
- major

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "bump-version"
bump-version:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check out the content (source branch). Use a deploy key so that
# when we push changes, it will trigger the release workflow
# run that runs on: tag. (Using the GitHub token would
# not run the workflow to prevent infinite recursion.)

- name: Check out source
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.7.1
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install packages
run: pnpm i

- name: Setup Git
run: |
git config user.name 'f3ve'
git config user.email '${{ secrets.MY_EMAIL }}'
- name: bump version
run: npm version ${{ github.event.inputs.version }}

- name: Push latest version
run: git push origin main --follow-tags
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
push:
tags:
- 'v*'

name: 🚀 Release

jobs:
publish-to-npm:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: main

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.7.1

- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm i

- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Compile code
run: pnpm run build

- name: Publish
run: pnpm publish --access=public --no-git-checks

create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: publish-to-npm
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Create Release
run: gh release create ${{ github.ref }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.experimental.useFlatConfig": true
}
19 changes: 0 additions & 19 deletions CHANGELOG.md

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Freedom Evenden

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
65 changes: 0 additions & 65 deletions auto-imports.d.ts

This file was deleted.

9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import f3veEslintConfig from '@f3ve/eslint-config';

export default f3veEslintConfig({
prettier: true,
typescript: true,
browser: true,
node: true,
vue: true,
});
Loading

0 comments on commit 6b95391

Please sign in to comment.