diff --git a/.github/workflows/test.yml b/.github/workflows/build.yml similarity index 53% rename from .github/workflows/test.yml rename to .github/workflows/build.yml index e1f3c21..bdf932f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Test +name: Build & Test on: pull_request: @@ -9,6 +9,10 @@ on: - main workflow_dispatch: +defaults: + run: + shell: bash + jobs: test: runs-on: ubuntu-latest @@ -47,3 +51,33 @@ jobs: files: /tmp/test-coverage.txt fail_ci_if_error: true verbose: true + tag: + name: "Tag Version" + runs-on: ubuntu-latest + outputs: + branch: ${{ steps.set-outputs.outputs.branch }} + tag: ${{ steps.bump_version.outputs.tag }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + - name: Extract branch name + run: | + if [ "$GITHUB_EVENT_NAME" == "push" ]; then + echo BRANCH_NAME=main >> $GITHUB_ENV + else + echo BRANCH_NAME=${{ github.head_ref }} >> $GITHUB_ENV + fi + id: extract_branch + + - name: Bump version + if: github.actor != 'dependabot[bot]' + id: bump_version + uses: anothrNick/github-tag-action@1.36.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INITIAL_VERSION: 1.0.0 + DEFAULT_BUMP: minor + PRERELEASE_SUFFIX: ${{ env.BRANCH_NAME }} + RELEASE_BRANCHES: main + WITH_V: true \ No newline at end of file