Skip to content

Commit

Permalink
Prototype on-tagging-for-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jcholder-thoughtworks committed Feb 3, 2021
1 parent 8793a79 commit 5bcc271
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 24 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: CI
name: Build and Publish Packaged Release

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
build-and-publish:
runs-on: ubuntu-latest

steps:
Expand All @@ -29,17 +27,17 @@ jobs:
with:
ruby-version: '2.7'

- name: Install Jekyll
run: |
gem install bundler
bundle install
- name: Update Publisher executable
run: bash _updatePublisher.sh --force --yes --skip-ping
- name: Generate Implementation Guide (IG)
run: bash _genonce.sh
- name: Install jsonfile package
run: npm install jsonfile
# - name: Install Jekyll
# run: |
# gem install bundler
# bundle install
# - name: Update Publisher executable
# run: bash _updatePublisher.sh --force --yes --skip-ping
# - name: Generate Implementation Guide (IG)
# run: bash _genonce.sh
# - name: Install jsonfile package
# run: npm install jsonfile
- name: Publish to Package Repository
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash _publishToRepo.sh
run: bash _publishToRepo.sh --release-version ${{ github.ref }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create Release from Tag

on:
push:
tags:
- 'v*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
create-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
Tagged release ${{ github.ref }}
26 changes: 19 additions & 7 deletions _publishToRepo.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
#!/bin/bash
tar -zxf ./output/package.tgz -C ./output
node updatePackage.js
cp ./output/*-2.json ./output/package/ # Copy over original json+eml
node localizeLibraryPaths.js ./output/package/*-2.json
echo "registry=https://npm.pkg.github.com/chronic-care" >> ./output/package/.npmrc
cd ./output/package
npm publish

packageVersion=false

while [ "$#" -gt 0 ]; do
case $1 in
--release-version) packageVersion="$2" ;;
esac
shift
done

echo Package Version: $packageVersion

#tar -zxf ./output/package.tgz -C ./output
#node updatePackage.js
#cp ./output/*-2.json ./output/package/ # Copy over original json+eml
#node localizeLibraryPaths.js ./output/package/*-2.json
#echo "registry=https://npm.pkg.github.com/chronic-care" >> ./output/package/.npmrc
#cd ./output/package
#npm publish

0 comments on commit 5bcc271

Please sign in to comment.