Skip to content

Commit

Permalink
Add new auth packages to release GitHub action (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttrinh authored Nov 8, 2023
1 parent 7a76cb9 commit 98d09aa
Showing 1 changed file with 117 additions and 22 deletions.
139 changes: 117 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ jobs:
yarn
yarn workspaces run build
# Driver
- name: Changelog Vars
run: |
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
# edgedb

- name: Copy readme
run: cp README.md packages/driver/README.md
Expand All @@ -46,14 +51,43 @@ jobs:
- name: If publish 'edgedb'
if: steps.publish_driver.outputs.type != 'none'
run: |
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
echo "Published ${{ steps.publish_driver.outputs.type }} version: ${{ steps.publish_driver.outputs.version }}"
- name: If 'edgedb' version unchanged
if: steps.publish_driver.outputs.type == 'none'
run: |
echo "Version in package.json has not changed. Skipping."
# Generate
- name: Build 'edgedb' Changelog
id: github_driver_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.ref }}
commitMode: true
configurationJson: |
{
"template": "## Commits:\n\n#{{UNCATEGORIZED}}",
"pr_template": "- #{{MERGE_SHA}} #{{TITLE}}",
"categories": []
}
- name: Create 'edgedb' Release
if: steps.publish_driver.outputs.type != 'none'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.publish_driver.outputs.version }}
release_name: edgedb-js v${{ steps.publish_driver.outputs.version }}
commitish: ${{ github.ref }}
body: ${{steps.github_driver_release.outputs.changelog}}
draft: true
prerelease: false

# @edgedb/generate

- id: publish_generate
name: Publish '@edgedb/generate' to NPM
Expand All @@ -66,22 +100,64 @@ jobs:
- name: If publish '@edgedb/generate'
if: steps.publish_generate.outputs.type != 'none'
run: |
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
echo "Published ${{ steps.publish_generate.outputs.type }} version: ${{ steps.publish_generate.outputs.version }}"
- name: If '@edgedb/generate' version unchanged
if: steps.publish_generate.outputs.type == 'none'
run: |
echo "Version in package.json has not changed. Skipping."
# Changelogs
- name: Build '@edgedb/generate' Changelog
id: github_generate_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.ref }}
commitMode: true
configurationJson: |
{
"template": "## Commits:\n\n#{{UNCATEGORIZED}}",
"pr_template": "- #{{MERGE_SHA}} #{{TITLE}}",
"categories": []
}
- name: Create '@edgedb/generate' Release
if: steps.publish_generate.outputs.type != 'none'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: generate-v${{ steps.publish_generate.outputs.version }}
release_name: \@edgedb/generate v${{ steps.publish_generate.outputs.version }}
commitish: ${{ github.ref }}
body: ${{steps.github_generate_release.outputs.changelog}}
draft: true
prerelease: false

# @edgedb/auth-core

- name: Changelog Vars
- id: publish_auth_core
name: Publish '@edgedb/auth-core' to NPM
users: JS-DevTools/npm-publish@v1
with:
package: packages/auth-core/package.json
token: ${{ secrets.NPM_TOKEN }}
dry-run: false

- name: If publish '@edgedb/auth-core'
if: steps.publish_auth_core.outputs.type != 'none'
run: |
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "Published ${{ steps.publish_auth_core.outputs.type }} version: ${{ steps.publish_auth_core.outputs.version }}"
- name: Build 'edgedb' Changelog
id: github_driver_release
- name: If '@edgedb/auth-core' version unchanged
if: steps.public_auth_core.outputs.type == 'none'
run: |
echo "Version in package.json has not changed. Skipping."
- name: Build '@edgedb/auth-core' Changelog
id: github_auth_core_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -96,22 +172,41 @@ jobs:
"categories": []
}
- name: Create 'edgedb' Release
if: steps.publish_driver.outputs.type != 'none'
- name: Create '@edgedb/auth-core' Release
if: steps.publish_auth_core.outputs.type != 'none'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.publish_driver.outputs.version }}
release_name: edgedb-js v${{ steps.publish_driver.outputs.version }}
tag_name: auth-core-v${{ steps.publish_auth_core.outputs.version }}
release_name: \@edgedb/auth-core v${{ steps.publish_auth_core.outputs.version }}
commitish: ${{ github.ref }}
body: ${{steps.github_driver_release.outputs.changelog}}
body: ${{steps.github_auth_core_release.outputs.changelog}}
draft: true
prerelease: false

# @edgedb/auth-nextjs

- name: Build '@edgedb/generate' Changelog
id: github_generate_release
- id: publish_auth_nextjs
name: Publish '@edgedb/auth-nextjs' to NPM
users: JS-DevTools/npm-publish@v1
with:
package: packages/auth-nextjs/package.json
token: ${{ secrets.NPM_TOKEN }}
dry-run: false

- name: If publish '@edgedb/auth-nextjs'
if: steps.publish_auth_nextjs.outputs.type != 'none'
run: |
echo "Published ${{ steps.publish_auth_nextjs.outputs.type }} version: ${{ steps.publish_auth_nextjs.outputs.version }}"
- name: If '@edgedb/auth-nextjs' version unchanged
if: steps.public_auth_nextjs.outputs.type == 'none'
run: |
echo "Version in package.json has not changed. Skipping."
- name: Build '@edgedb/auth-nextjs' Changelog
id: github_auth_nextjs_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -126,15 +221,15 @@ jobs:
"categories": []
}
- name: Create '@edgedb/generate' Release
if: steps.publish_generate.outputs.type != 'none'
- name: Create '@edgedb/auth-nextjs' Release
if: steps.publish_auth_nextjs.outputs.type != 'none'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: generate-v${{ steps.publish_generate.outputs.version }}
release_name: \@edgedb/generate v${{ steps.publish_generate.outputs.version }}
tag_name: auth-nextjs-v${{ steps.publish_auth_nextjs.outputs.version }}
release_name: \@edgedb/auth-nextjs v${{ steps.publish_auth_nextjs.outputs.version }}
commitish: ${{ github.ref }}
body: ${{steps.github_generate_release.outputs.changelog}}
body: ${{steps.github_auth_nextjs_release.outputs.changelog}}
draft: true
prerelease: false

0 comments on commit 98d09aa

Please sign in to comment.