Skip to content

Commit

Permalink
ci: Create stable public paths
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Nov 19, 2023
1 parent 607c403 commit 58fe508
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/release-info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Update Release Info

on:
push:
branches:
- main
paths:
- ".github/workflows/release-info.yml"
- "packages/action-release-info/*"
schedule:
- cron: 0 4 * * *
workflow_dispatch:
Expand All @@ -21,10 +27,14 @@ jobs:
with:
# renovate: datasource=docker depName=node versioning=node
node-version: "20.9.0"
- run: yarn install --immutable
- run: yarn workspace @kitten-science/action-release-info tsc --build
- name: Install dependencies
run: yarn install --immutable
- name: Build the release-info action
run: yarn workspace @kitten-science/action-release-info tsc --build

- uses: ./packages/action-release-info
- name: Generate release information
id: release-info
uses: ./packages/action-release-info
with:
filename: release-info.json
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -39,3 +49,19 @@ jobs:
- name: Deploy to S3
run: |
aws s3 cp release-info.json s3://${{ secrets.AWS_S3_BUCKET }}
aws s3api put-object \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key dev.js \
--cache-control "public; s-maxage=60" \
--website-redirect-location "${{ steps.release-info.outputs.dev-url-default }}"
aws s3api put-object \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key nightly.js \
--cache-control "public; s-maxage=86400" \
--website-redirect-location "${{ steps.release-info.outputs.nightly-url-default }}"
aws s3api put-object \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key stable.js \
--cache-control "public; s-maxage=86400" \
--website-redirect-location "${{ steps.release-info.outputs.stable-url-default }}"
3 changes: 3 additions & 0 deletions packages/action-release-info/source/ReleaseInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ export class ReleaseInfo {
writeFileSync(filename, JSON.stringify(releaseInfo, undefined, 2));
}

core.setOutput("dev-url-default", releaseInfo.dev.url.default);
core.setOutput("nightly-url-default", releaseInfo.nightly.url.default);
core.setOutput("stable-url-default", releaseInfo.stable.url.default);
console.dir(releaseInfo);
}
}

0 comments on commit 58fe508

Please sign in to comment.