Skip to content

publish

publish #241

Workflow file for this run

name: publish
on:
workflow_dispatch:
inputs:
ci_status:
description: 'required CI status'
default: 'success'
required: true
prerelease:
description: 'prerelease name'
required: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: 'check successful status'
run: |
REF_STATUS=$(curl -s \
'https://api.github.com/repos/${{ github.repository }}/commits/${{ github.ref }}/status' \
| jq .state)
[[ "${REF_STATUS}" == '"${{ github.event.inputs.ci_status }}"' ]] || \
(echo "::error ::${{ github.ref }} does not have a successful CI status" && false)
- name: Add foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 16
- uses: actions/setup-python@v2
- name: 'configure git'
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
- name: 'Checkout new branch'
run: /
git checkout -b testpublish/${{ github.ref }}-${{ github.run_id }}-${{ github.run_number }}
git push -u origin testpublish/${{ github.ref }}-${{ github.run_id }}-${{ github.run_number }}
- name: 'install dependencies'
run: |
yarn -D
- name: 'Test Commits'
run: /
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 }}
branch: 'publish/${{ github.ref }}-${{ github.run_id }}-${{ github.run_number }}'
title: 'Published ${{ github.ref }}'
body: 'Syncing CHANGELOG and package version updates from publish action ${{github.run_id}}-${{github.run_number}} into ${{ github.ref}} branch'
reviewers: ${{ github.actor }}
delete-branch: true
- 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 }}
title: 'Published {{ github.ref }}'
body: 'Syncing CHANGELOG and package version updates from published ${{ github.ref }} branch into main branch'
reviewers: ${{ github.actor }}