diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..b6f60a3 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,31 @@ +--- +name: PR + +on: + pull_request: + types: + - edited + - opened + - reopened + - synchronize + +jobs: + title: + name: Check Title + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Check + uses: stordco/actions-pr-title@v1.0.0 + with: + regex: '^(feat!|fix!|fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*' + hint: | + You can pass the following formats: + + fix: [OR-123] some title of the PR + fix(scope): [OR-123] some title of the PR + feat: [OR-1234] some title of the PR + chore: update some action diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..98e3d35 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +--- +name: Release + +on: + push: + branches: + - main + +jobs: + please: + name: Please + runs-on: ubuntu-latest + + steps: + - name: Release + uses: google-github-actions/release-please-action@v3 + with: + release-type: node + package-name: actions-elixir + token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + extra-files: README.md + + - if: ${{ steps.release.outputs.release_created }} + name: Checkout + uses: actions/checkout@v3 + with: + ref: my-branch + token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + persist-credentials: true + + - if: ${{ steps.release.outputs.release_created }} + name: Tag + run: | + git config user.name stord-engineering-account + git config user.email engineering@stord.com + + git tag -d v${{ steps.release.outputs.major }} || true + git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git push origin :v${{ steps.release.outputs.major }} || true + git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + + git tag -a v${{ steps.release.outputs.major }} -m "chore(main): release ${{ steps.release.outputs.major }}" + git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "chore(main): release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" + git push origin v${{ steps.release.outputs.major }} + git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..dab1647 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + "setup": "0.1.2" +} diff --git a/README.md b/README.md index c5f6caa..27cf786 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,28 @@ # actions-elixir + GitHub Actions for simplifying Elixir operations -# Overview +## Overview + stordco/actions-elixir implements composite actions for simplifying Elixir operations - setup, dependency retrieval, etc. -# `stordco/actions-elixir/setup` Action +## `stordco/actions-elixir/setup` Action -## Usage +### Usage + + ```yaml - uses: stordco/actions-elixir/setup@v0.1 with: - elixir_version: 1.13.4 + elixir_version: "1.13" github_personal_access_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }} - otp_version: 25.0 + otp_version: "25.0" ``` + + +### Inputs -## Inputs - `cache_path` - (Optional) Override default paths to cache - `elixir_version` - Specify Elixir version - `github_personal_access_token` - (Optional) Usually `secrets.GITHUB_PERSONAL_ACCESS_TOKEN`, to setup git for mix dep retrieval diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..7c9d126 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,7 @@ +{ + "separate-pull-requests": false, + "draft-pull-request": true, + "packages": { + "setup": {} + } +}