Remove -develop from version #8
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: Publish Alpha podverse-external-services | |
| on: | |
| push: | |
| branches: | |
| - v5-alpha | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| # Set up Node.js | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.16.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install podverse-helpers latest alpha version | |
| run: | | |
| npm i podverse-helpers@alpha --save | |
| # Clean install dependencies | |
| - name: Clean install dependencies | |
| run: npm clean-install | |
| # Increment alpha version | |
| - name: Increment alpha version | |
| id: version | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| BASE_VERSION=$(echo $CURRENT_VERSION | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*$/\1/') | |
| PACKAGE_NAME=$(node -p "require('./package.json').name") | |
| # Get all versions as a comma-separated string, then split and filter | |
| VERSIONS=$(npm view $PACKAGE_NAME versions | tr -d "[]'," | tr ' ' '\n' | grep "^${BASE_VERSION}-alpha\.[0-9]\+$" || true) | |
| if [[ -z "$VERSIONS" ]]; then | |
| NEXT_ALPHA_VERSION=0 | |
| else | |
| LAST_ALPHA=$(echo "$VERSIONS" | sed -E 's/.*-alpha\.([0-9]+)$/\1/' | sort -n | tail -1) | |
| NEXT_ALPHA_VERSION=$((LAST_ALPHA + 1)) | |
| fi | |
| NEXT_VERSION="${BASE_VERSION}-alpha.${NEXT_ALPHA_VERSION}" | |
| # Update package.json with the new version | |
| - name: Update package.json | |
| run: | | |
| npm version $NEXT_VERSION --no-git-tag-version | |
| # Build the module | |
| - name: Build module | |
| run: npm run build | |
| # Publish to npm | |
| - name: Publish to npm | |
| run: npm publish --tag alpha | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.ALPHA_NPM_TOKEN }} |