diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..249f87c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6f2ea65 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 }}