Skip to content

Commit

Permalink
ci: replace bump lib by jscutlery/semver
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Mar 1, 2023
1 parent f542c48 commit 83a3cc4
Show file tree
Hide file tree
Showing 19 changed files with 1,382 additions and 369 deletions.
33 changes: 6 additions & 27 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,22 @@ inputs:
npm-token:
description: NPM token
required: true
version:
description: version type (patch, minor, major, ...)
required: true
last-release:
description: previous release commit hash
required: true

runs:
using: composite
steps:
- name: Version
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: Setup Git
shell: bash
run: npx nx affected --base=${{ inputs.last-release }} --target=version --type=${{ inputs.version }}
run: |
git config user.name "GitHub Bot"
git config user.email "ed@getlarge.eu"
- name: Publish on NPM
shell: bash
run: npx nx affected --base=${{ inputs.last-release }} --target=publish
- name: Version
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}

- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/nx-heroku

- name: Tag last-release
shell: bash
run: git tag -f ${{ steps.package-version.outputs.current-version }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ inputs.github-token }}
branch: ${{ github.ref }}
force: true
tags: true
run: npx nx affected --base=${{ inputs.last-release }} --target=version
16 changes: 7 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
type: choice
default: ''
options:
- path
- patch
- minor
- major

Expand Down Expand Up @@ -48,6 +48,9 @@ jobs:
with:
from: ${{ steps.set-shas.outputs.base }}

outputs:
from: ${{ steps.set-shas.outputs.base }}

release:
runs-on: ubuntu-latest

Expand All @@ -61,18 +64,13 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
github-token: ${{ secrets.GH_PAT }}

- name: Derive appropriate SHAs for base and head for `nx affected` commands
id: set-shas
uses: nrwl/nx-set-shas@v3
with:
last-successful-event: release
github-token: ${{ secrets.GITHUB_TOKEN }}
node-version: '16'

- name: Release
uses: ./.github/actions/release
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
npm-token: ${{ secrets.NPM_TOKEN }}
version: ${{ inputs.version }}
last-release: ${{ steps.set-shas.outputs.base }}
last-release: ${{ needs.tests.outputs.from }}
Loading

0 comments on commit 83a3cc4

Please sign in to comment.