workflow cleanup
This commit is contained in:
parent
f33283c69b
commit
f55c7d2393
1 changed files with 18 additions and 15 deletions
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
|
@ -34,7 +34,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
currentVersion="$( node -e "console.log(require('./package.json').version)" )"
|
currentVersion="$( node -e "console.log(require('./package.json').version)" )"
|
||||||
isPublished="$( npm view tileserver-gl versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
|
isPublished="$( npm view tileserver-gl versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
|
||||||
RELEASE_TYPE="$(node -e "console.log(require('semver').prerelease('$PACKAGE_VERSION') ? 'prerelease' : 'regular')")"
|
RELEASE_TYPE="$(node -e "console.log(require('semver').prerelease('$currentVersion') ? 'prerelease' : 'regular')")"
|
||||||
echo "version=$currentVersion" >> "$GITHUB_OUTPUT"
|
echo "version=$currentVersion" >> "$GITHUB_OUTPUT"
|
||||||
echo "published=$isPublished" >> "$GITHUB_OUTPUT"
|
echo "published=$isPublished" >> "$GITHUB_OUTPUT"
|
||||||
if [[ $RELEASE_TYPE == 'regular' ]]; then
|
if [[ $RELEASE_TYPE == 'regular' ]]; then
|
||||||
|
@ -55,6 +55,10 @@ jobs:
|
||||||
if: ${{ needs.release-check.outputs.published == 'false' }}
|
if: ${{ needs.release-check.outputs.published == 'false' }}
|
||||||
name: 'Build, Test, Publish'
|
name: 'Build, Test, Publish'
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
env:
|
||||||
|
PACKAGE_VERSION: ${{ needs.release-check.outputs.version }}
|
||||||
|
PRERELEASE: ${{ needs.release-check.outputs.prerelease }}
|
||||||
|
DOCKER_TAG: ${{ env.PRERELEASE == 'true' && 'next' || 'latest' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository ✨
|
- name: Check out repository ✨
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -95,7 +99,7 @@ jobs:
|
||||||
- name: Publish to NPM
|
- name: Publish to NPM
|
||||||
run: |
|
run: |
|
||||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||||
npm publish --access public --tag ${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }}
|
npm publish --access public --tag ${{ env.PRERELEASE == 'true' && 'next' || 'latest' }}
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
||||||
|
|
||||||
|
@ -119,7 +123,7 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
maptiler/tileserver-gl:${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }},
|
maptiler/tileserver-gl:${{ env.DOCKER_TAG }},
|
||||||
maptiler/tileserver-gl:v${{ env.PACKAGE_VERSION }}
|
maptiler/tileserver-gl:v${{ env.PACKAGE_VERSION }}
|
||||||
platforms: linux/arm64,linux/amd64
|
platforms: linux/arm64,linux/amd64
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
|
@ -127,7 +131,7 @@ jobs:
|
||||||
|
|
||||||
- name: Extract changelog for version
|
- name: Extract changelog for version
|
||||||
run: |
|
run: |
|
||||||
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ needs.release-check.outputs.version }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
|
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ env.PACKAGE_VERSION }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
|
||||||
cat changelog_for_version.md
|
cat changelog_for_version.md
|
||||||
|
|
||||||
- name: Publish to Github
|
- name: Publish to Github
|
||||||
|
@ -135,25 +139,25 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag: v${{ needs.release-check.outputs.version }}
|
tag: v${{ env.PACKAGE_VERSION }}
|
||||||
name: v${{ needs.release-check.outputs.version }}
|
name: v${{ env.PACKAGE_VERSION }}
|
||||||
bodyFile: changelog_for_version.md
|
bodyFile: changelog_for_version.md
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: ${{ needs.release-check.outputs.prerelease }}
|
prerelease: ${{ env.PRERELEASE }}
|
||||||
|
|
||||||
- name: Create Tileserver Light Directory
|
- name: Create Tileserver Light Directory
|
||||||
run: node publish.js --no-publish
|
run: node publish.js --no-publish
|
||||||
|
|
||||||
- name: Install node dependencies
|
- name: Install node dependencies
|
||||||
run: npm install
|
run: npm ci --prefer-offline --no-audit
|
||||||
working-directory: ./light
|
working-directory: ./light
|
||||||
|
|
||||||
- name: Publish to Light Version NPM
|
- name: Publish to Light Version NPM
|
||||||
working-directory: ./light
|
working-directory: ./light
|
||||||
run: |
|
run: |
|
||||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||||
npm publish --access public --tag ${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }}
|
npm publish --access public --tag ${{ env.PRERELEASE == 'true' && 'next' || 'latest' }}
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
||||||
|
|
||||||
|
@ -164,9 +168,8 @@ jobs:
|
||||||
file: ./light/Dockerfile
|
file: ./light/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
maptiler/tileserver-gl-light:${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }},
|
maptiler/tileserver-gl-light:${{ env.DOCKER_TAG }},
|
||||||
maptiler/tileserver-gl-light:v${{ env.PACKAGE_VERSION }}
|
maptiler/tileserver-gl-light:v${{ env.PACKAGE_VERSION }}
|
||||||
platforms: linux/arm64,linux/amd64
|
platforms: linux/arm64,linux/amd64
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
Loading…
Reference in a new issue