mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
Add missing release steps (#5874)
Closes #5868 - Run `corepack yarn workspace @uppy/angular prepublishOnly` - Upload to CDN - Update versions in readme's to latest CDN version - Bring back Companion docker deploy
This commit is contained in:
parent
5fe6ea14dc
commit
5a9f53c501
1 changed files with 83 additions and 0 deletions
83
.github/workflows/release.yml
vendored
83
.github/workflows/release.yml
vendored
|
|
@ -11,9 +11,13 @@ jobs:
|
|||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
companionWasReleased: ${{ steps.checkIfCompanionWasReleased.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
|
|
@ -30,6 +34,9 @@ jobs:
|
|||
- name: Build
|
||||
run: corepack yarn build
|
||||
|
||||
- name: '@uppy/angular prepublish'
|
||||
run: corepack yarn workspace @uppy/angular prepublishOnly
|
||||
|
||||
- run: |
|
||||
echo '' >> .yarnrc.yml
|
||||
echo 'npmAuthToken: "${NPM_TOKEN}"' >> .yarnrc.yml
|
||||
|
|
@ -45,3 +52,79 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Remove npmAuthToken from yarnrc
|
||||
run: |
|
||||
sed -i '/npmAuthToken:/d' .yarnrc.yml
|
||||
|
||||
- name: Check if Companion was released
|
||||
id: checkIfCompanionWasReleased
|
||||
run: |
|
||||
git diff --exit-code --quiet HEAD^ -- packages/@uppy/companion/package.json || echo "version=$(jq -r .version < packages/@uppy/companion/package.json)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload `uppy` to CDN
|
||||
run: corepack yarn run uploadcdn uppy -- --force
|
||||
env:
|
||||
EDGLY_KEY: ${{secrets.EDGLY_KEY}}
|
||||
EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
|
||||
|
||||
- name: Upload `@uppy/locales` to CDN if it was released
|
||||
run: corepack yarn run uploadcdn @uppy/locales -- --force
|
||||
env:
|
||||
EDGLY_KEY: ${{secrets.EDGLY_KEY}}
|
||||
EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
|
||||
|
||||
- name: Update CDN version references
|
||||
run: |
|
||||
VERSION=$(yarn workspace uppy exec npm pkg get version | grep -o '"[0-9]*\.[0-9]*\.[0-9]*"' | tr -d '"')
|
||||
sed -i "s|https://releases\.transloadit\.com/uppy/v[0-9]*\.[0-9]*\.[0-9]*/|https://releases.transloadit.com/uppy/v$VERSION/|g" README.md
|
||||
sed -i "s|https://releases\.transloadit\.com/uppy/v[0-9]*\.[0-9]*\.[0-9]*/|https://releases.transloadit.com/uppy/v$VERSION/|g" BUNDLE-README.md
|
||||
|
||||
- name: Commit README updates
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add README.md BUNDLE-README.md
|
||||
git commit -m "Update CDN version references to latest release" || exit 0
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# See also companion-deploy.yml
|
||||
docker:
|
||||
name: DockerHub
|
||||
needs: release
|
||||
if: ${{ needs.release.outputs.companionWasReleased }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_BUILDKIT: 0
|
||||
COMPOSE_DOCKER_CLI_BUILD: 0
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
||||
with:
|
||||
images: transloadit/companion
|
||||
tags: |
|
||||
type=edge
|
||||
type=semver,pattern={{version}},value=${{ needs.release.outputs.companionWasReleased }}
|
||||
# set latest tag for default branch
|
||||
type=raw,value=latest,enable=true
|
||||
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Log in to DockerHub
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
with:
|
||||
username: ${{secrets.DOCKER_USERNAME}}
|
||||
password: ${{secrets.DOCKER_PASSWORD}}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: Dockerfile
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue