diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 789b708..759058e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: 18 - name: Install dependencies @@ -24,3 +24,32 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release + upload-to-cdn: + name: Upload to Foxy CDN + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.COMMIT_KEY }} + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Install dependencies + run: npm ci + - name: Build + run: npm run prepack + - name: Get the latest tag name and set it to the env variable + run: | + echo "LATEST_TAG_NAME=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + - 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' diff --git a/.github/workflows/s3cdn.yml b/.github/workflows/s3cdn.yml deleted file mode 100644 index 3d03634..0000000 --- a/.github/workflows/s3cdn.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: S3CDN upload - -on: - push: - tags: - - '*' -jobs: - test: - runs-on: ubuntu-20.04 - steps: - - name: Checkout Foxy/foxy-elements - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 18 - - name: Install dependencies - run: npm ci - - name: Build - run: npm run prepack - - uses: Foxy/foxy-github-action-s3cdn@main - with: - package-name: sdk # optional: Default is repo name. - 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' # optional: defaults to `dist` directory diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 0000000..f002f17 --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -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