feat(node): install npm-check-updates
#125
This file contains 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: Release | |
on: | |
push: | |
branches: | |
- main | |
- prerelease | |
jobs: | |
release: | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: write | |
uses: zanminkian/github-actions/.github/workflows/release.yml@v1 | |
secrets: inherit | |
upload-assets: | |
permissions: | |
contents: write | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- if: ${{ needs.release.outputs.published == 'true' }} | |
run: | | |
version=$(echo '${{ needs.release.outputs.publishedPackages }}' | jq -r '.[0].version') | |
echo "version is $version" | |
# 1. pull tar files by tag (ref name) | |
curl -fLsS https://get.docker.com/ | sh | |
# pull amd | |
docker pull --platform=linux/amd64 zengmingjian/web-ide:$version | |
docker save zengmingjian/web-ide:$version | gzip > web-ide-$version-linux-amd64.tgz | |
docker image rm zengmingjian/web-ide:$version | |
# pull arm | |
docker pull --platform=linux/arm64 zengmingjian/web-ide:$version | |
docker save zengmingjian/web-ide:$version | gzip > web-ide-$version-linux-arm64.tgz | |
docker image rm zengmingjian/web-ide:$version | |
ls -alh | |
# 2. upload tar files | |
release_id=$( | |
curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
"https://api.github.com/repos/zanminkian/web-ide/releases/tags/v$version" | jq -r ".id" | |
) | |
echo "release id is $release_id" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"https://uploads.github.com/repos/zanminkian/web-ide/releases/$release_id/assets?name=web-ide-$version-linux-amd64.tgz" \ | |
-T "web-ide-$version-linux-amd64.tgz" >/dev/null 2>&1 | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"https://uploads.github.com/repos/zanminkian/web-ide/releases/$release_id/assets?name=web-ide-$version-linux-arm64.tgz" \ | |
-T "web-ide-$version-linux-arm64.tgz" >/dev/null 2>&1 |