Skip to content

Publish new version πŸš€ #722

Publish new version πŸš€

Publish new version πŸš€ #722

Workflow file for this run

name: 'Publish new version πŸš€'
on:
workflow_dispatch:
schedule:
# every day at 16:00
- cron: '0 16 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
has-refs: ${{ steps.has-refs.outputs.has-refs }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: myparcelnl/actions/has-refs-between@v4
id: has-refs
# Run setup initially to save cache and time on subsequent jobs
setup:
needs: prepare
if: needs.prepare.outputs.has-refs == 'true'
uses: ./.github/workflows/--setup.yml
secrets: inherit
test-unit:
needs: setup
uses: ./.github/workflows/--test-unit.yml
secrets: inherit
test-integration:
needs: setup
uses: ./.github/workflows/--test-integration.yml
secrets: inherit
analyse:
needs: setup
uses: ./.github/workflows/--analyse.yml
secrets: inherit
quality:
needs: setup
uses: ./.github/workflows/--quality.yml
secrets: inherit
release:
runs-on: ubuntu-22.04
needs:
- test-unit
- test-integration
- analyse
- quality
outputs:
released: ${{ steps.semantic-release.outputs.released }}
version: ${{ steps.semantic-release.outputs.version }}
previous-version: ${{ steps.semantic-release.outputs.previous-version }}
release-type: ${{ steps.semantic-release.outputs.release-type }}
steps:
- uses: myparcelnl/actions/setup-git-credentials@v4
id: credentials
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.credentials.outputs.token }}
- uses: myparcelnl/actions/yarn-install@v4
- uses: myparcelnl/actions/semantic-release@v4
id: semantic-release
with:
token: ${{ steps.credentials.outputs.token }}
write-summary: true
rebase-prs:
needs: release
uses: ./.github/workflows/--rebase-prs.yml
secrets: inherit
trigger:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-22.04
strategy:
matrix:
repo: ${{ fromJSON(vars.PDK_DEPENDENT_REPOS) }}
steps:
- uses: myparcelnl/actions/repository-dispatch@v4
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
repository: ${{ matrix.repo }}
event-type: 'pdk-update'
client-payload: |-
{
"version": "${{ needs.release.outputs.version }}",
"previousVersion": "${{ needs.release.outputs.previous-version }}",
"type": "${{ needs.release.outputs.release-type }}"
}
notify-on-failure:
needs:
- prepare
- setup
- test-unit
- test-integration
- analyse
- quality
- trigger
if: always() && contains(needs.*.result, 'failure')
uses: myparcelnl/actions/.github/workflows/notify-on-failure.yml@v4
secrets: inherit