Skip to content

Commit

Permalink
meta: update manual-cdn workflow (#5329)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Jul 11, 2024
1 parent aeff9dd commit a2f1472
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 23 deletions.
41 changes: 35 additions & 6 deletions .github/workflows/manual-cdn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ name: Manually triggered CDN upload
on:
workflow_dispatch:
inputs:
name:
description: 'Package to upload'
package:
description: Package to upload
required: true
default: 'uppy'
type: choice
options:
- uppy
- '@uppy/locales'
version:
description: Version to upload (from npm)
type: string
force:
description: --force
type: boolean
default: false

env:
YARN_ENABLE_GLOBAL_CACHE: false
Expand All @@ -32,15 +42,34 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
- name: Install upload-to-cdn dependencies
if: ${{ inputs.version }}
run: corepack yarn workspaces focus @uppy-dev/upload-to-cdn
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Install all dependencies
if: ${{ !inputs.version }}
run: corepack yarn install --immutable
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Build before publishing
if: ${{ !inputs.version }}
run: corepack yarn run build
- name: Upload `${{ github.event.inputs.name }}` to CDN
run: corepack yarn run uploadcdn ${{ github.event.inputs.name }}
- name: Upload "${{ inputs.package }}" to CDN
if: ${{ !inputs.force }}
run: corepack yarn run uploadcdn "$PACKAGE" "$VERSION"
env:
PACKAGE: ${{inputs.package}}
VERSION: ${{inputs.version}}
EDGLY_KEY: ${{secrets.EDGLY_KEY}}
EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
- name: Upload "${{ inputs.package }}" to CDN
if: ${{ inputs.force }}
run: corepack yarn run uploadcdn "$PACKAGE" "$VERSION" -- --force
env:
PACKAGE: ${{inputs.package}}
VERSION: ${{inputs.version}}
EDGLY_KEY: ${{secrets.EDGLY_KEY}}
EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"e2e"
],
"devDependencies": {
"@aws-sdk/client-s3": "^3.338.0",
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.11.3",
Expand All @@ -61,11 +60,9 @@
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@uppy-dev/remark-lint-uppy": "workspace:*",
"adm-zip": "^0.5.5",
"autoprefixer": "^10.2.6",
"babel-plugin-inline-package-json": "^2.0.0",
"chalk": "^5.0.0",
"concat-stream": "^2.0.0",
"cssnano": "^7.0.0",
"dotenv": "^16.0.0",
"esbuild": "^0.21.2",
Expand All @@ -91,11 +88,8 @@
"glob": "^8.0.0",
"jsdom": "^24.0.0",
"lint-staged": "^15.0.0",
"mime-types": "^2.1.26",
"npm-packlist": "^5.0.0",
"npm-run-all": "^4.1.5",
"onchange": "^7.1.0",
"pacote": "^13.0.0",
"postcss": "^8.4.31",
"postcss-dir-pseudo-class": "^6.0.0",
"postcss-logical": "^5.0.0",
Expand All @@ -109,7 +103,6 @@
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-scss": "^13.0.0",
"tar": "^6.1.0",
"typescript": "~5.4",
"vitest": "^1.2.1",
"vue-template-compiler": "workspace:*"
Expand Down Expand Up @@ -159,7 +152,7 @@
"test:unit": "yarn run build:lib && yarn test:watch --run",
"test:watch": "vitest --environment jsdom --dir packages/@uppy",
"test": "npm-run-all lint test:locale-packs:unused test:unit test:companion",
"uploadcdn": "yarn node ./bin/upload-to-cdn.js",
"uploadcdn": "yarn node ./private/upload-to-cdn/index.js",
"version": "yarn node ./bin/after-version-bump.js",
"watch:css": "onchange 'packages/{@uppy/,}*/src/*.scss' --initial --verbose -- yarn run build:css",
"watch:js:bundle": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx}' --initial --verbose -- yarn run build:bundle",
Expand Down
4 changes: 2 additions & 2 deletions bin/upload-to-cdn.js → private/upload-to-cdn/index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
//
// Run as:
//
// npm run uploadcdn <package-name> [version]
// yarn uploadcdn <package-name> [version]
//
// To override an existing release (DANGER!)
//
// npm run uploadcdn <package-name> [version] -- --force
// yarn uploadcdn <package-name> [version] -- --force
//
// Authors:
//
Expand Down
12 changes: 12 additions & 0 deletions private/upload-to-cdn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@uppy-dev/upload-to-cdn",
"devDependencies": {
"@aws-sdk/client-s3": "^3.338.0",
"adm-zip": "^0.5.5",
"concat-stream": "^2.0.0",
"mime-types": "^2.1.26",
"npm-packlist": "^5.0.0",
"pacote": "^13.0.0",
"tar": "^6.1.0"
}
}
21 changes: 14 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8010,7 +8010,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy-dev/build@workspace:."
dependencies:
"@aws-sdk/client-s3": "npm:^3.338.0"
"@babel/cli": "npm:^7.14.5"
"@babel/core": "npm:^7.14.6"
"@babel/eslint-parser": "npm:^7.11.3"
Expand All @@ -8028,11 +8027,9 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:^7.0.0"
"@typescript-eslint/parser": "npm:^7.0.0"
"@uppy-dev/remark-lint-uppy": "workspace:*"
adm-zip: "npm:^0.5.5"
autoprefixer: "npm:^10.2.6"
babel-plugin-inline-package-json: "npm:^2.0.0"
chalk: "npm:^5.0.0"
concat-stream: "npm:^2.0.0"
cssnano: "npm:^7.0.0"
dotenv: "npm:^16.0.0"
esbuild: "npm:^0.21.2"
Expand All @@ -8058,11 +8055,8 @@ __metadata:
glob: "npm:^8.0.0"
jsdom: "npm:^24.0.0"
lint-staged: "npm:^15.0.0"
mime-types: "npm:^2.1.26"
npm-packlist: "npm:^5.0.0"
npm-run-all: "npm:^4.1.5"
onchange: "npm:^7.1.0"
pacote: "npm:^13.0.0"
postcss: "npm:^8.4.31"
postcss-dir-pseudo-class: "npm:^6.0.0"
postcss-logical: "npm:^5.0.0"
Expand All @@ -8076,7 +8070,6 @@ __metadata:
stylelint-config-rational-order: "npm:^0.1.2"
stylelint-config-standard: "npm:^36.0.0"
stylelint-config-standard-scss: "npm:^13.0.0"
tar: "npm:^6.1.0"
typescript: "npm:~5.4"
vitest: "npm:^1.2.1"
vue-template-compiler: "workspace:*"
Expand Down Expand Up @@ -8147,6 +8140,20 @@ __metadata:
languageName: unknown
linkType: soft

"@uppy-dev/upload-to-cdn@workspace:private/upload-to-cdn":
version: 0.0.0-use.local
resolution: "@uppy-dev/upload-to-cdn@workspace:private/upload-to-cdn"
dependencies:
"@aws-sdk/client-s3": "npm:^3.338.0"
adm-zip: "npm:^0.5.5"
concat-stream: "npm:^2.0.0"
mime-types: "npm:^2.1.26"
npm-packlist: "npm:^5.0.0"
pacote: "npm:^13.0.0"
tar: "npm:^6.1.0"
languageName: unknown
linkType: soft

"@uppy-example/angular@workspace:examples/angular-example":
version: 0.0.0-use.local
resolution: "@uppy-example/angular@workspace:examples/angular-example"
Expand Down

0 comments on commit a2f1472

Please sign in to comment.