diff --git a/.github/workflows/run-tests-and-create-tag.yml b/.github/workflows/run-tests-and-create-tag.yml new file mode 100644 index 0000000..2d0b5c6 --- /dev/null +++ b/.github/workflows/run-tests-and-create-tag.yml @@ -0,0 +1,35 @@ +name: Run Tests and Create Tag + +on: + push: + branches: [ main ] + paths-ignore: [ '.gitignore', '.swift-format', 'README.md', 'LICENSE' ] + +jobs: + run_tests_and_create_tag: + runs-on: macos-14 + env: + GITHUB_TOKEN: ${{ secrets.CUSTOM_ACCESS_TOKEN }} + permissions: + contents: write + steps: + - name: Set XCode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "15" + - name: Checkout project including tags + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run tests + run: swift test + - name: Get next version + id: get-next-version + uses: paulhatch/semantic-version@v5.0.0-alpha2 + with: + tag_prefix: "v" + search_commit_body: false + - uses: ncipollo/release-action@v1 + with: + commit: main + tag: ${{ steps.get-next-version.outputs.version_tag }} diff --git a/.github/workflows/run-tests-pr.yml b/.github/workflows/run-tests-pr.yml new file mode 100644 index 0000000..c05c2c5 --- /dev/null +++ b/.github/workflows/run-tests-pr.yml @@ -0,0 +1,21 @@ +name: Run Tests PR + +on: + pull_request: + branches: [ main ] + paths-ignore: [ '.gitignore', '.swift-format', 'README.md', 'LICENSE' ] + +jobs: + run_tests_pr: + runs-on: macos-14 + steps: + - name: Set XCode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "15" + - name: Checkout project including tags + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run tests + run: swift test