diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index f04c630..b5b011c 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -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: @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..758627e --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file diff --git a/_publishToRepo.sh b/_publishToRepo.sh index 4991523..d8350d4 100755 --- a/_publishToRepo.sh +++ b/_publishToRepo.sh @@ -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 \ No newline at end of file + +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 \ No newline at end of file