Charts v6.3.0 #411
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Publishes a package to marketplace" | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: "Release tag (e.g. data-widgets-v1.2.3)" | |
| required: true | |
| jobs: | |
| publish-new-version: | |
| name: "Publish a new package version from GitHub release" | |
| runs-on: ubuntu-latest | |
| env: | |
| TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.package }} | |
| steps: | |
| - name: Check release tag | |
| run: | | |
| match=$(node -p "(/^[a-z0-9-]+-v\d+\.\d+\.\d+$/m).exec('$TAG') ? 1 : -1") | |
| if [ $match -eq -1 ]; | |
| then | |
| echo "::error::Invalid tag format." | |
| exit 1 | |
| fi | |
| - name: "Set PACKAGE env var" | |
| run: echo "PACKAGE=@mendix/${TAG%-v*}" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 | |
| - name: Setup node | |
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - name: Search for package in workspace | |
| run: | | |
| if [[ -z "$(pnpm ls --json --filter=$PACKAGE)" ]]; | |
| then | |
| echo "::error::Package $PACKAGE not found in workspace."; | |
| exit 1; | |
| fi | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Include OSS README in MPK artifact | |
| run: pnpm run include-oss-in-artifact | |
| env: | |
| GH_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run publish script | |
| run: pnpm run publish-marketplace --filter=$PACKAGE | |
| env: | |
| CPAPI_URL: ${{ secrets.CPAPI_URL }} | |
| CPAPI_USER: ${{ secrets.CPAPI_USER }} | |
| CPAPI_USER_OPENID: ${{ secrets.SRV_WIDGETS_OPENID }} | |
| CPAPI_PASS: ${{ secrets.CPAPI_PASS }} | |
| GH_PAT: ${{ secrets.GITHUB_TOKEN }} |