-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-bump-profiles-package
- Loading branch information
Showing
11 changed files
with
66 additions
and
1,380 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -15,62 +15,72 @@ jobs: | |
|
||
- run: npm ci | ||
|
||
- name: Get releases | ||
id: fetch-latest-release | ||
uses: ./.github/actions/fetch-latest-release | ||
with: | ||
github_token: ${{ github.token }} | ||
|
||
- name: Calculate edge version | ||
id: calculate-edge-version | ||
uses: ./.github/actions/calculate-edge-version | ||
with: | ||
version: ${{ steps.fetch-latest-release.outputs.tag_name }} | ||
|
||
- name: Release PR | ||
uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
release-type: node | ||
release-as: ${{ steps.calculate-edge-version.outputs.next-edge }} | ||
prerelease: true | ||
default-branch: master | ||
release-search-depth: 20 | ||
changelog-path: CHANGELOG-edge.md | ||
|
||
# The logic below handles the npm publication: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
# these if statements ensure that a publication only occurs when | ||
# a new release is created: | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Get current version from package.json | ||
id: get_version | ||
run: | | ||
current_version=$(node -p "require('./package.json').version") | ||
echo "current_version=${current_version}" >> $GITHUB_OUTPUT | ||
- name: Calculate next version | ||
id: get_next_version | ||
run: | | ||
next_version=$(npx semver ${{ steps.get_version.outputs.current_version }} -i patch) | ||
echo "Next patch version: $next_version" | ||
echo "version=$next_version" >> $GITHUB_OUTPUT | ||
- name: Configure Git | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Checkout or create edge branch | ||
run: | | ||
git fetch origin | ||
if git rev-parse --verify origin/${{ steps.get_next_version.outputs.version }}-edge; then | ||
git checkout ${{ steps.get_next_version.outputs.version }}-edge | ||
else | ||
git checkout -b ${{ steps.get_next_version.outputs.version }}-edge | ||
fi | ||
- name: Bump version | ||
id: bump_version | ||
run: | | ||
new_version=$(npm version prerelease --preid=edge) | ||
echo "New edge version: $new_version" | ||
echo "new_version=${new_version}" >> $GITHUB_OUTPUT | ||
- name: Push version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git push origin ${{ steps.get_next_version.outputs.version }}-edge | ||
- run: npm run build-all | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- run: npm publish --tag edge | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
if: ${{ steps.release.outputs.release_created }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Set Notification Messages | ||
id: set-messages | ||
if: steps.release.outputs.release_created | ||
run: | | ||
if [[ ${{ job.status }} == "success" ]]; then | ||
echo "SLACK_TITLE=Video Player ${{ steps.release.outputs.tag_name }} Deployed" >> $GITHUB_OUTPUT | ||
echo "SLACK_MESSAGE=Success :rocket: cloudinary-video-player version ${{ steps.release.outputs.tag_name }} deployed successfully" >> $GITHUB_OUTPUT | ||
echo "SLACK_TITLE=Video Player ${{ steps.bump_version.outputs.new_version }} Deployed" >> $GITHUB_OUTPUT | ||
echo "SLACK_MESSAGE=Success :rocket: cloudinary-video-player version ${{ steps.bump_version.outputs.new_version }} deployed successfully" >> $GITHUB_OUTPUT | ||
echo "SLACK_FOOTER=Check it out at https://cloudinary.github.io/cloudinary-video-player/?ver=edge&min=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "SLACK_TITLE=Video Player Deployment Failed" >> $GITHUB_OUTPUT | ||
echo "SLACK_MESSAGE=:alert: Failed to deploy cloudinary-video-player version ${{ steps.release.outputs.tag_name }}" >> $GITHUB_OUTPUT | ||
echo "SLACK_MESSAGE=:alert: Failed to deploy cloudinary-video-player version ${{ steps.bump_version.outputs.new_version }}" >> $GITHUB_OUTPUT | ||
echo "SLACK_FOOTER=See log here https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }}" >> $GITHUB_OUTPUT | ||
fi | ||
shell: bash | ||
|
||
- name: Slack Notification | ||
if: steps.release.outputs.release_created | ||
uses: rtCamp/[email protected] | ||
env: | ||
SLACK_WEBHOOK: ${{ vars.FE_DEPLOYMENTS_SLACK_WEBHOOK }} | ||
|
@@ -81,7 +91,6 @@ jobs: | |
SLACK_FOOTER: ${{ steps.set-messages.outputs.SLACK_FOOTER }} | ||
|
||
- uses: gacts/purge-jsdelivr-cache@v1 | ||
if: steps.release.outputs.release_created | ||
with: | ||
url: | | ||
https://cdn.jsdelivr.net/npm/cloudinary-video-player@edge |
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
Oops, something went wrong.