Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.semantic-release.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -20,7 +22,45 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
# Expose the tag this run created (empty when nothing was released) so the CDN job uploads the new version.
run: |
git tag --points-at HEAD | sort > "$RUNNER_TEMP/tags-before"
npx semantic-release
git tag --points-at HEAD | sort > "$RUNNER_TEMP/tags-after"
echo "tag=$(comm -13 "$RUNNER_TEMP/tags-before" "$RUNNER_TEMP/tags-after" | head -n 1)" >> "$GITHUB_OUTPUT"
upload-to-cdn:
name: Upload to Foxy CDN
needs: release
if: needs.release.outputs.tag != ''
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Build
run: npm run prepack
- name: Upload to s3cdn
uses: Foxy/foxy-github-action-s3cdn@main
with:
package-name: sdk
env:
AWS_S3_CDN_BUCKET_NAME: ${{ secrets.AWS_S3_CDN_BUCKET_NAME }}
AWS_S3_CDN_KEY_ID: ${{ secrets.AWS_S3_CDN_KEY_ID }}
AWS_S3_CDN_KEY_SECRET: ${{ secrets.AWS_S3_CDN_KEY_SECRET }}
SOURCE_DIR: 'dist/cdn'
LATEST_TAG_NAME: ${{ needs.release.outputs.tag }}
- name: Invalidate CloudFront cache
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_CDN_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_CDN_KEY_SECRET }}
AWS_DEFAULT_REGION: us-east-1
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/sdk*"
28 changes: 0 additions & 28 deletions .github/workflows/s3cdn.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/validate-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: PR Title Validation
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
jobs:
validate_pr_title:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: 'Validate PR title with commitizen'
steps:
- run: pip install commitizen
- run: cat $GITHUB_EVENT_PATH | jq -r '.pull_request .title' | cz check
Loading