Compare commits

...

10 Commits

Author SHA1 Message Date
Savarn Dontamsetti
9b53c9f939
Change github.ref to github.ref_name 2023-08-24 14:45:26 -04:00
Savarn Dontamsetti
518d2e55b4
Don't delete the branch after PR creation 2023-08-24 14:31:31 -04:00
Savarn Dontamsetti
b2d1a2fab9
More formatting fixes 2023-08-24 14:08:11 -04:00
Savarn Dontamsetti
ff531fc7e9
Fix missing closing bracket 2023-08-24 13:59:33 -04:00
Savarn Dontamsetti
230f0d57ee
Adding test commits 2023-08-24 13:56:35 -04:00
Savarn Dontamsetti
1ca6815f2c
Fix Formatting 3 2023-08-24 13:41:19 -04:00
Savarn Dontamsetti
db6013b594
Fix Formatting 2023-08-24 13:40:10 -04:00
Savarn Dontamsetti
ce9a48c102
Fix Formatting 2023-08-24 13:39:00 -04:00
Savarn Dontamsetti
25374cdf47
Formatting 2023-08-24 10:33:50 -04:00
Savarn Dontamsetti
7be1954010
Create PRs to reflect publish changes 2023-08-24 10:28:37 -04:00

View File

@ -1,15 +1,15 @@
name: publish
on:
workflow_dispatch:
inputs:
ci_status:
description: 'required CI status'
default: 'success'
required: true
prerelease:
description: 'prerelease name'
required: false
workflow_dispatch:
inputs:
ci_status:
description: 'required CI status'
default: 'success'
required: true
prerelease:
description: 'prerelease name'
required: false
jobs:
publish:
@ -28,30 +28,52 @@ jobs:
version: nightly
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
ref: ${{ github.ref }}
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 16
- uses: actions/setup-python@v2
- name: 'configure git'
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "Github Actions"
- name: 'Checkout new branch'
run: |
git checkout -b publish/${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_number }}
git push -u origin publish/${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_number }}
- name: 'install dependencies'
run: |
yarn -D
- name: 'build and publish'
- name: 'Test Commits'
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
npm run run:publish:gha
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
PUBLISH_PRERELEASE: ${{ github.event.inputs.prerelease }}
- name: 'merge into main branch'
if: github.event.inputs.prerelease == '' # unless it's a prerelease
run: |
git checkout main && \
git merge ${{ github.ref }} && \
echo "Dummy File" > dummy.txt
git add . --all
git commit -m "Updated CHANGELOGS & MD docs"
git push
# - name: 'build and publish'
# run: |
# echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
# npm run run:publish:gha
# env:
# NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
# GITHUB_TOKEN: ${{ github.token }}
# PUBLISH_PRERELEASE: ${{ github.event.inputs.prerelease }}
- name: 'Create PR to merge into ref branch'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ github.token }}
base: ${{ github.ref_name }}
branch: 'publish/${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_number }}'
title: 'Published ${{ github.ref_name }}'
body: 'Syncing CHANGELOG and package version updates from publish action ${{github.run_id}}-${{github.run_number}} into ${{ github.ref_name}} branch'
reviewers: ${{ github.actor }}
- name: 'Create PR to merge ref branch into main'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ github.token }}
base: main
branch: ${{ github.ref_name }}
title: 'Published ${{ github.ref_name }}'
body: 'Syncing CHANGELOG and package version updates from published ${{ github.ref_name }} branch into main branch'
reviewers: ${{ github.actor }}