Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
dahu33 committed Apr 14, 2023
0 parents commit e57cd72
Show file tree
Hide file tree
Showing 312 changed files with 61,090 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Generate SDK

on:
workflow_dispatch:
inputs:
version:
description: The SDK version to generate as "X.Y.Z".
default: "X.Y.Z"
required: true
type: string
openapi-generator-version:
description: The openapi-generator version to use. '' for the version used during the last generation, 'latest' for latest, 'x.y.z' for version x.y.z.
default: "latest"
required: true
type: string

env:
# Go / Node / PostgreSQL version to use in the CI
NODE_VER: "18"
GO_VER: "1.19"

jobs:
generate:
name: Generate SDK
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
OPENAPI_GENERATOR_VERSION: "${{ github.event.inputs.openapi-generator-version }}"
steps:
- name: Check Tag
run: |
if ! [[ ${{ github.event.inputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
echo "::error ::The provided version has incorrect format: it should match '[0-9]+\.[0-9]+\.[0-9]+(-.+)?'" 1>&2
exit 1
fi
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE_VER }}"
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: "${{ env.GO_VER }}"
- name: Generate SDK to check for changes
run: ./generate.sh
- name: Check for changes
id: check-changes
run: |
if ! git status --porcelain=v1 | grep -v -e openapitools.json -e .openapi-generator/VERSION | tee /dev/stderr | [ $(wc -l) -ne 0 ]; then
echo "::notice ::No changes to the MultiBaas SDK detected." 1>&2
echo "regenerate=false" >> $GITHUB_OUTPUT
fi
- name: Generate SDK with new package version
if: steps.check-changes.outputs.regenerate != 'false'
run: ./generate.sh ${{ github.event.inputs.version }}
- name: Setup Git Configurations
if: steps.check-changes.outputs.regenerate != 'false'
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: Push and tag
if: steps.check-changes.outputs.regenerate != 'false'
run: |
git add .
git commit -am "Auto-generated SDK v${{ github.event.inputs.version }}"
git tag "v${{ github.event.inputs.version }}" main
git push origin "v${{ github.event.inputs.version }}"
git push origin main
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof
30 changes: 30 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

test/*
git_push.sh
.travis.yml
example/*
errors.go
go.work
Loading

0 comments on commit e57cd72

Please sign in to comment.