Releases/6.x.x/6.15.x/6.15.3 rc2 #42
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
name: Prepare plugin for production | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
branches: | ||
- 'master' | ||
jobs: | ||
Prepare-Plugin-For-Production: | ||
if: startsWith(github.head_ref, 'releases/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login to Github | ||
with: | ||
token: ${{ secrets.CI_DEV_GITHUB_TOKEN }} | ||
persist-credentials: true | ||
env: | ||
COMMIT_AUTHOR: ${{ secrets.CI_COMMIT_AUTHOR }} | ||
COMMIT_EMAIL: ${{ secrets.CI_COMMIT_EMAIL }} | ||
MY_PERSONAL_ACCESS_TOKEN: ${{ secrets.CI_DEV_GITHUB_TOKEN }} | ||
run: | | ||
Check failure on line 24 in .github/workflows/pre-release-workflow.yml
|
||
git config --global user.name $COMMIT_AUTHOR | ||
git config --global user.email $COMMIT_EMAIL | ||
git config --global credential.helper 'cache --timeout=300' | ||
git config --global --add "credential.https://github.com.username" "x-access-token" | ||
echo "https://x-access-token:[email protected]" > ~/.git-credentials | ||
- uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.CI_DEV_GITHUB_TOKEN }} | ||
- name: Update package.json file | ||
run: | | ||
plugin_version=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9].[0-9]+.[0-9]+') | ||
# we export plugin_version and release branch name as env so we can use them in the next step | ||
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV | ||
echo "GIT_BRANCH_RELEASE=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV | ||
echo "Updating plugin to version $plugin_version" | ||
echo "The plugin version is ${plugin_version}" | ||
npm version $plugin_version --allow-same-version | ||
git push origin HEAD:${{ steps.vars.outputs.branch }} --force | ||
- name: Update CHANGELOG.md | ||
env: | ||
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }} | ||
JIRA_FIXED_VERSION: "Cordova SDK v${{env.PLUGIN_VERSION}}" | ||
run: | | ||
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh | ||
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION" | ||
NEW_VERSION_RELEASE_NOTES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt) | ||
NEW_VERSION_SECTION="## ${{ env.PLUGIN_VERSION }}\n Release date: *$(date +%F)*\n\n$NEW_VERSION_RELEASE_NOTES\n" | ||
echo -e "$NEW_VERSION_SECTION\n$(cat RELEASENOTES.md)" > RELEASENOTES.md | ||
git add RELEASENOTES.md | ||
git commit -m "Update RELEASENOTES.md" | ||
git push origin HEAD:${{ env.GIT_BRANCH_RELEASE }} --force |