diff --git a/.github/workflows/pull-request-open.yml b/.github/workflows/pull-request-open.yml new file mode 100644 index 00000000..3023e0aa --- /dev/null +++ b/.github/workflows/pull-request-open.yml @@ -0,0 +1,19 @@ +name: 'Assign pull request author' + +on: + pull_request: + types: + - opened + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + assign-author: + runs-on: ubuntu-22.04 + steps: + - uses: myparcelnl/actions/pr-assign-author@v3 + with: + app-id: ${{ secrets.MYPARCEL_APP_ID }} + private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }} diff --git a/.github/workflows/pull-request-review.yml b/.github/workflows/pull-request-review.yml new file mode 100644 index 00000000..3365a46a --- /dev/null +++ b/.github/workflows/pull-request-review.yml @@ -0,0 +1,19 @@ +name: 'Label pull request' + +on: + pull_request_review: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + +jobs: + label: + runs-on: ubuntu-22.04 + steps: + - uses: myparcelnl/actions/pr-label-by-review@v3 + with: + app-id: ${{ secrets.MYPARCEL_APP_ID }} + private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }} + label-approved: 'approved' + label-changes-requested: 'changes requested' + protection-type: 'rulesets' diff --git a/.github/workflows/pull-request-title.yml b/.github/workflows/pull-request-title.yml new file mode 100644 index 00000000..207060c0 --- /dev/null +++ b/.github/workflows/pull-request-title.yml @@ -0,0 +1,20 @@ +name: 'Lint pull request title' + +on: + pull_request: + types: + - opened + - edited + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-22.04 + steps: + - uses: myparcelnl/actions/pr-validate-title-conventional@v3 + with: + app-id: ${{ secrets.MYPARCEL_APP_ID }} + private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index be1ed275..0966812f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,3 +14,32 @@ jobs: test: uses: ./.github/workflows/test.yml secrets: inherit + + build: + runs-on: ubuntu-22.04 + needs: + - test + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + + - uses: ./.github/actions/build + id: build + with: + app-id: ${{ secrets.MYPARCEL_APP_ID }} + private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }} + + - name: 'Determine version' + id: version + #language=sh + run: | + version=$(npm pkg get version | sed 's/"//g') + releaseVersion="$version-${{ github.event.pull_request.number}}.${{ github.event.pull_request.head.sha }}" + + echo "version=$releaseVersion" >> $GITHUB_OUTPUT + + - uses: ./.github/actions/release + id: release + with: + version: ${{ steps.version.outputs.version }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 94991103..d7865ea1 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -15,6 +15,35 @@ jobs: uses: ./.github/workflows/test.yml secrets: inherit + build: + runs-on: ubuntu-22.04 + needs: + - test + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + + - uses: ./.github/actions/build + id: build + with: + app-id: ${{ secrets.MYPARCEL_APP_ID }} + private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }} + + - name: 'Determine version' + id: version + #language=sh + run: | + version=$(npm pkg get version | sed 's/"//g') + releaseVersion="$version-${{ github.sha }}" + + echo "version=$releaseVersion" >> $GITHUB_OUTPUT + + - uses: ./.github/actions/release + id: release + with: + version: ${{ steps.version.outputs.version }} + rebase-prs: needs: - test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9e60b1b..6d61882f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,6 @@ name: '🚀 Release' on: - push: - branches: - - main - - develop - workflow_dispatch: concurrency: