Skip to content

Commit

Permalink
Merge pull request #232 from nitrictech/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
tjholm authored Oct 29, 2021
2 parents 7e1de02 + bca443e commit 3295aa3
Show file tree
Hide file tree
Showing 85 changed files with 2,413 additions and 1,108 deletions.
96 changes: 0 additions & 96 deletions .github/workflows/draft-release.yaml

This file was deleted.

34 changes: 19 additions & 15 deletions .github/workflows/publish-on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,32 @@ jobs:
registry-url: 'https://registry.npmjs.org'
always-auth: true

- name: Normalize version string
run: |
version="${{ github.event.release.tag_name }}"
echo "::set-output name=VERSION::`echo ${version:1}`"
id: normalize_version

- name: Install Dependencies
run: yarn --immutable

# Update version metadata to match tag version
- name: Update Versions
run: yarn version:all ${{ steps.normalize_version.outputs.VERSION }}

- name: Build Common
run: yarn build:common

- name: Publish to NPM
# Release Production
- name: Publish latest to NPM
if: "!github.event.release.prerelease"
run: yarn publish:all
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Normalize version string
run: |
version="${{ github.event.release.tag_name }}"
echo "::set-output name=VERSION::`echo ${version:1}`"
id: normalize_version

# Signal the releases repostory to prepare a release
- name: Chocolatey Release
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
repository: nitrictech/cli-chocolatey
event-type: choco-release
client-payload: '{"version": "${{ steps.normalize_version.outputs.VERSION }}"}'
# release RC
- name: Publish latest RC to NPM
if: "github.event.release.prerelease"
run: yarn publish:all --tag rc-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/rc-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Bump Package Versions, Tag and Draft Release

on:
pull_request:
types: [closed]
branches:
- 'develop'

jobs:
version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
dry_run: true
release_branches: main,develop
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Add SHORT_SHA to outputs
id: vars
run: echo "::set-output name=sha_short::$(echo ${GITHUB_SHA} | cut -c1-8)"

- name: Create a GitHub release
uses: actions/create-release@v1
env:
# Use nitric bot token to trigger release actions
GITHUB_TOKEN: ${{ secrets.NITRIC_BOT_TOKEN }}
with:
prerelease: true
tag_name: ${{ steps.tag_version.outputs.new_tag }}-rc.${{ steps.vars.outputs.sha_short }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}-rc.${{ steps.vars.outputs.sha_short }}
body: ${{ steps.tag_version.outputs.changelog }}

32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Bump Package Versions, Tag and Draft Release

on:
pull_request:
types: [closed]
branches:
- 'main'

jobs:
version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
release_branches: main
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create a GitHub release
uses: actions/create-release@v1
env:
# use nitric bot token to trigger release actions
GITHUB_TOKEN: ${{ secrets.NITRIC_BOT_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ lib/
!**/src/**/*

oclif.manifest.json

# Autogenerated change log
CHANGELOG.md
Loading

0 comments on commit 3295aa3

Please sign in to comment.