Skip to content

Commit

Permalink
revert publish script changes
Browse files Browse the repository at this point in the history
  • Loading branch information
flamestro committed May 25, 2024
1 parent f94da39 commit 159bcf1
Showing 1 changed file with 20 additions and 57 deletions.
77 changes: 20 additions & 57 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,65 +36,28 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node ${{ matrix.node_version }}
uses: actions/setup-node@v2
- uses: actions/checkout@v2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install
run: yarn install
- name: Set Current Version
run: |
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Tag Check
id: tag_check
run: |
GET_API_URL="https://github.com/gitapi/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
-H "Authorization: token ${GITHUB_TOKEN}")
if [ "$http_status_code" -ne "404" ] ; then
echo "::set-output name=exists_tag::true"
else
echo "::set-output name=exists_tag::false"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Git Tag
if: steps.tag_check.outputs.exists_tag == 'false'
uses: pkgdeps/git-tag-action@v2
with:
version: ${{ env.CURRENT_VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
- name: Create Release
id: create_release
if: steps.tag_check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: "0"

- uses: actions/setup-node@v3
with:
tag_name: v${{ env.CURRENT_VERSION }}
release_name: ${{ github.event.pull_request.title }}
body: |
${{ github.event.pull_request.body }}
draft: false
prerelease: false
- name: Publish
if: steps.tag_check.outputs.exists_tag == 'false'
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Setup Git
run: |
npx lerna publish from-package --yes
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Publish Packages 🚀
working-directory: ./packages/compose-as-code
run: yarn && yarn tsc

- name: Publish Packages 🚀
env:
CI: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx lerna publish

0 comments on commit 159bcf1

Please sign in to comment.