diff --git a/.github/.keepalive b/.github/.keepalive index 9a48eb0..ae7d4f1 100644 --- a/.github/.keepalive +++ b/.github/.keepalive @@ -1 +1 @@ -2022-07-01T01:06:30.423Z +2022-08-01T01:09:43.701Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 128c22e..5094681 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -21,12 +21,19 @@ name: productionize # Workflow triggers: on: - # Run workflow when a new commit is pushed to the repository: + # Run workflow when a new commit is pushed to the main branch: push: + branches: + - main # Allow the workflow to be manually run: workflow_dispatch: +# Concurrency group to prevent multiple concurrent executions: +concurrency: + group: productionize + cancel-in-progress: true + # Workflow jobs: jobs: @@ -168,8 +175,8 @@ jobs: # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest - # Indicate that this job depends on the prior job finishing: - needs: productionize + # Indicate that this job depends on the test job finishing: + needs: test # Define the sequence of job steps... steps: @@ -202,13 +209,15 @@ jobs: run: | git checkout -b deno origin/deno - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs rm -rf + find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm + find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf git add -A - git commit -m "Remove files" + git commit -m "Remove files" --allow-empty - git merge -s recursive -X theirs origin/production --allow-unrelated-histories + git config merge.theirs.name 'simulate `-s theirs`' + git config merge.theirs.driver 'cat %B > %A' + GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories # If `deno` does not exist, create `deno` branch: - name: 'If `deno` does not exist, create `deno` branch' @@ -292,8 +301,8 @@ jobs: # Delete everything in current directory aside from deno folder: - name: 'Delete everything in current directory aside from deno folder' run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs rm -rf + find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm + find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf # Move deno directory to root: - name: 'Move deno directory to root' @@ -307,21 +316,12 @@ jobs: git add -A git commit -m "Auto-generated commit" - # Push changes to `deno` branch or create new branch tag: - - name: 'Push changes to `deno` branch or create new branch tag' + # Push changes to `deno` branch: + - name: 'Push changes to `deno` branch' run: | SLUG=${{ github.repository }} - VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p') - if [ -z "$VERSION" ]; then - echo "Workflow job was not triggered by a new tag...." - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - else - echo "Workflow job was triggered by a new tag: $VERSION" - echo "Creating new bundle branch tag of the form $VERSION-deno" - git tag -a $VERSION-deno -m "$VERSION-deno" - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-deno - fi + echo "Pushing changes to $SLUG..." + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' @@ -341,8 +341,8 @@ jobs: # Define the type of virtual host machine on which to run the job: runs-on: ubuntu-latest - # Indicate that this job depends on the prior job finishing: - needs: productionize + # Indicate that this job depends on the test job finishing: + needs: test # Define the sequence of job steps... steps: @@ -375,13 +375,15 @@ jobs: run: | git checkout -b umd origin/umd - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs rm -rf + find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm + find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf git add -A - git commit -m "Remove files" + git commit -m "Remove files" --allow-empty - git merge -s recursive -X theirs origin/production --allow-unrelated-histories + git config merge.theirs.name 'simulate `-s theirs`' + git config merge.theirs.driver 'cat %B > %A' + GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories # If `umd` does not exist, create `umd` branch: - name: 'If `umd` does not exist, create `umd` branch' @@ -458,13 +460,13 @@ jobs: find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/