Skip to content

Commit

Permalink
ci: add ci and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwillox committed Dec 10, 2023
1 parent 123b7f3 commit 1bd669e
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "CI"

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Setup pnpm"
uses: pnpm/action-setup@v2

- name: "Setup node"
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "pnpm"

- name: "Install dependencies"
run: pnpm install

- name: "Check format"
run: pnpm run format:check

build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Setup pnpm"
uses: pnpm/action-setup@v2

- name: "Setup node"
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "pnpm"

- name: "Install dependencies"
run: pnpm install

- name: "Run Build"
run: pnpm run build

test-action:
name: "Test Action"
runs-on: ubuntu-latest

steps:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Test Action"
id: test-action1
uses: ./
with:
preset: "cloud-sql-proxy"

- name: "Show Outputs"
run: |
echo "path=${{ steps.test-action1.outputs.path }}"
echo "version=${{ steps.test-action1.outputs.version }}"
- name: "Test Action"
id: test-action2
uses: ./
with:
preset: "infisical-cli"

- name: "Show Outputs"
run: |
echo "path=${{ steps.test-action2.outputs.path }}"
echo "version=${{ steps.test-action2.outputs.version }}"
- name: "Show Versions"
run: |
cloud-sql-proxy --version
infisical --version
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Release"

on:
push:
branches:
- "beta"
- "alpha"
workflow_dispatch:
inputs:
draft:
type: boolean
description: "Draft release"
default: false
release_type:
type: choice
description: "Release type"
default: "auto"
options:
- "auto"
- "patch"
- "minor"
- "major"

jobs:
publish:
name: "Publish"
runs-on: ubuntu-latest
steps:
- name: "Checkout the repository"
uses: actions/checkout@v3

- name: "Setup pnpm"
uses: pnpm/action-setup@v2

- name: "Setup node"
uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: "pnpm"

- name: "Install dependencies"
run: pnpm install

- name: "Run Build"
run: pnpm run build

- name: "Release Package 📦"
run: pnpm dlx @jcwillox/semantic-release-config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEMANTIC_RELEASE_GITHUB_DRAFT: ${{ inputs.draft }}
SEMANTIC_RELEASE_FORCE_RELEASE: ${{ inputs.release_type }}

0 comments on commit 1bd669e

Please sign in to comment.