diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ee55245 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 + +[*.{json, yml, yaml, md, js, ts}] +indent_size = 2 + +[*.{bat, ps1}] +end_of_line = crlf diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2593ff4..2fbafcf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,15 +1,10 @@ -name: docker +name: docker-cache on: # push: # branches: # - main workflow_dispatch: - inputs: - type: - description: 'Type' - required: true - default: javascript jobs: hello_world_job: diff --git a/.github/workflows/p1.yml b/.github/workflows/p1.yml new file mode 100644 index 0000000..b9d4b84 --- /dev/null +++ b/.github/workflows/p1.yml @@ -0,0 +1,55 @@ +name: build-p1 + +on: + pull_request: + types: [ opened, synchronize, reopened, closed ] + branches: [ main, master ] + paths: + - '.github/workflows/p1.yml' + - 'p1/**' + push: + branches: [ main, master ] + tags: + - 'p1/v*' + paths: + - '.github/workflows/p1.yml' + - 'p1/**' + +jobs: + + context: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.OSS_GITHUB_TOKEN }} + + - name: Project context + id: context + uses: zero88/gh-project-context@v1 + with: + dry: false + defaultBranch: master + tagPrefix: p1/v + releaseBranchPrefix: release/p1/ + mergedReleaseMsgRegex: "^Merge pull request #[0-9]+ from .+/release/p1/.+$" + patterns: | + p1/version.py::(VERSION\s?=\s?)(')([^']+)(')::2 + + - name: Docker context + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v2 + with: + images: zero88/p1 + tags: | + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=sha + type=match,pattern=p1\/v(.*),group=1 + + - name: Print + run: | + echo "${{ steps.docker_meta.outputs.tags }}" + echo "${{ steps.docker_meta.outputs.labels }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index caf11a6..e5ef429 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: First run +name: GH-context on: push: @@ -6,10 +6,16 @@ on: - main tags: - v* + paths-ignore: + - 'p1/**' + - '.github/workflows/p1.yml' pull_request: types: [ opened, synchronize, reopened, closed ] branches: - 'main' + paths-ignore: + - 'p1/**' + - '.github/workflows/p1.yml' workflow_dispatch: jobs: diff --git a/p1/version.py b/p1/version.py new file mode 100644 index 0000000..1e5a605 --- /dev/null +++ b/p1/version.py @@ -0,0 +1 @@ +VERSION = '1.0.0'