diff --git a/.github/workflows/autotag.yml b/.github/workflows/autotag.yml new file mode 100644 index 0000000..aca6a9e --- /dev/null +++ b/.github/workflows/autotag.yml @@ -0,0 +1,67 @@ +name: autotag + +on: + push: + branches: + - main + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + + - name: Bump version and push tag + id: tag + uses: anothrNick/github-tag-action@1.36.0 + env: + WITH_V: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BUMP: none + RELEASE_BRANCHES: main + + outputs: + bump: ${{ steps.tag.outputs.part }} + new_tag: ${{ steps.tag.outputs.new_tag }} + + build_release: + runs-on: ubuntu-latest + needs: tag + if: needs.tag.outputs.bump + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Process changelog + run: | + if [[ ! -z $(cat changelog/next.md) ]] ; then + mv changelog/next.md changelog/${{ needs.tag.outputs.new_tag }}.md + touch changelog/next.md + fi + + - name: Set changelog path + id: changelog_path + run: | + if [-e changelog/${TAG}.md] + then + echo "::set-output name=changelog::${TAG}" + else + echo "::set-output name=changelog::next" + fi + env: + TAG: ${{ needs.tag.outputs.new_tag }} + + - name: Create Github release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ needs.tag.outputs.new_tag }} + release_name: Release ${{ needs.tag.outputs.new_tag }} + body_path: changelog/${{ steps.changelog_path.outputs.changelog }}.md + draft: false + prerelease: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index addd840..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: run-tests - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest, windows-latest] - php: [7.4, 8.0] - laravel: [8.*] - stability: [prefer-lowest, prefer-stable] - include: - - laravel: 8.* - testbench: ^6.6 - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo - coverage: none - - - name: Setup problem matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.stability }} --prefer-dist --no-interaction - - name: Execute tests - run: vendor/bin/phpunit diff --git a/changelog/next.md b/changelog/next.md new file mode 100644 index 0000000..f74e695 --- /dev/null +++ b/changelog/next.md @@ -0,0 +1 @@ +## Initial Tagged Release