diff --git a/.github/workflows/propose_release.yml b/.github/workflows/propose_release.yml new file mode 100644 index 0000000..81dfe43 --- /dev/null +++ b/.github/workflows/propose_release.yml @@ -0,0 +1,27 @@ +name: Propose Stable Release +on: + workflow_dispatch: + inputs: + release_type: + type: choice + description: Release Type + options: + - patch + - minor + - major +jobs: + update_version: + uses: neongeckocom/.github/.github/workflows/propose_semver_release.yml@master + with: + branch: dev + release_type: ${{ inputs.release_type }} + update_changelog: True + pull_changes: + uses: neongeckocom/.github/.github/workflows/pull_master.yml@master + needs: update_version + with: + pr_reviewer: neonreviewers + pr_assignee: ${{ github.actor }} + pr_draft: false + pr_title: ${{ needs.update_version.outputs.version }} + pr_body: ${{ needs.update_version.outputs.changelog }} \ No newline at end of file diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 41f0e79..290ee93 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -11,78 +11,10 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - tag_release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Get Version - run: | - VERSION=$(python setup.py --version) - echo "VERSION=${VERSION}" >> $GITHUB_ENV - - uses: ncipollo/release-action@v1 - with: - token: ${{secrets.GITHUB_TOKEN}} - tag: ${{env.VERSION}} - build_and_publish_pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install Build Tools - run: | - python -m pip install build wheel - - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{secrets.PYPI_TOKEN}} + build_and_publish_pypi_and_release: + uses: neongeckocom/.github/.github/workflows/publish_stable_release.yml@master + secrets: inherit build_and_publish_docker: - runs-on: ubuntu-latest - needs: build_and_publish_pypi - permissions: - contents: read - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Version - id: version - run: | - VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version)) - echo ::set-output name=version::${VERSION} - env: - image_name: ${{ env.IMAGE_NAME }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v2 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=raw,value=latest - type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + needs: build_and_publish_pypi_and_release + uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/publish_test_build.yml b/.github/workflows/publish_test_build.yml index ff7dc73..9f7e2d0 100644 --- a/.github/workflows/publish_test_build.yml +++ b/.github/workflows/publish_test_build.yml @@ -13,74 +13,13 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - build_and_publish_pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: Increment Version - run: | - VER=$(python setup.py --version) - python version_bump.py - - name: Push Version Change - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Increment Version - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{secrets.PYPI_TOKEN}} + publish_alpha_release: + uses: neongeckocom/.github/.github/workflows/publish_alpha_release.yml@master + secrets: inherit + with: + version_file: "version.py" + setup_py: "setup.py" build_and_publish_docker: - runs-on: ubuntu-latest - needs: build_and_publish_pypi - permissions: - contents: read - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Version - id: version - run: | - VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version)) - echo ::set-output name=version::${VERSION} - env: - image_name: ${{ env.IMAGE_NAME }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v2 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + needs: publish_alpha_release + uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pull_master.yml b/.github/workflows/pull_master.yml deleted file mode 100644 index aae67da..0000000 --- a/.github/workflows/pull_master.yml +++ /dev/null @@ -1,21 +0,0 @@ -# This workflow will generate a PR for changes in cert into master - -name: Pull to Master -on: - push: - branches: - - dev - workflow_dispatch: - -jobs: - pull_changes: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: pull-request-action - uses: repo-sync/pull-request@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - pr_reviewer: 'neonreviewers' - pr_assignee: 'neondaniel' - pr_draft: true diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 09ab0ca..9493599 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -6,22 +6,10 @@ on: workflow_dispatch: jobs: - build_tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel + py_build_tests: + uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master + docker_build_tests: + uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master unit_tests: strategy: matrix: