-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
98 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Upload a release from npm to the CDN | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
description: Package to upload | ||
required: true | ||
type: choice | ||
options: | ||
- uppy | ||
- '@uppy/locales' | ||
version: | ||
description: Version to upload (from npm) | ||
required: true | ||
type: string | ||
force: | ||
description: --force | ||
type: boolean | ||
default: false | ||
|
||
env: | ||
YARN_ENABLE_GLOBAL_CACHE: false | ||
|
||
jobs: | ||
upload-to-cdn: | ||
name: Upload to CDN | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: | ||
echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v4 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Install dependencies | ||
run: corepack yarn workspace focus upload-to-cdn | ||
env: | ||
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation | ||
CYPRESS_INSTALL_BINARY: 0 | ||
- 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}} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "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" | ||
} | ||
} |
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