Skip to content

Commit

Permalink
fix: Build Config updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sauravhiremath committed May 1, 2020
1 parent 35151c0 commit f228f8a
Showing 1 changed file with 37 additions and 13 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
with:
node-version: '12.x'

- name: Check Release Version
uses: thebongy/version-check@v1
with:
file: package.json
id: version_check

- name: Install dependencies
run: npm ci

Expand All @@ -28,42 +34,55 @@ jobs:
- name: Run Build
run: npm run build

- name: Create tarball
run: npm pack

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: juno-node@v${{ steps.version_check.outputs.releaseVersion }}
path: ./juno-node-${{ steps.version_check.outputs.releaseVersion }}.tgz

# Publish release on push to master
release-master:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2

- run: git fetch --all --tags

- name: Check Release Version
uses: thebongy/version-check@v1
with:
file: package.json
tagFormat: v${version}
tagFormat: ${version}
id: version_check

- name: Publish Release
id: create_release
uses: actions/create-release@latest
with:
tag_name: ${{ steps.version_check.outputs.releaseVersion }}
release_name: Juno-node @Linux Release ${{ steps.version_check.outputs.releaseVersion }}
tag_name: v${{ steps.version_check.outputs.releaseVersion }}
release_name: Juno-node@v${{ steps.version_check.outputs.releaseVersion }}
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: juno-node@v${{ steps.version_check.outputs.releaseVersion }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./juno-node-linux-${{ steps.version_check.outputs.releaseVersion }}.zip
asset_name: juno-node-linux-${{ steps.version_check.outputs.releaseVersion }}.zip
asset_content_type: application/zip
asset_path: juno-node-${{ steps.version_check.outputs.releaseVersion }}.tgz
asset_name: juno-node@v${{ steps.version_check.outputs.releaseVersion }}.tgz
asset_content_type: application/tgz

release-staging:
if: github.ref == 'refs/heads/staging'
Expand All @@ -77,15 +96,20 @@ jobs:
uses: thebongy/version-check@v1
with:
file: package.json
tagFormat: v${version}-beta
tagFormat: ${version}
id: version_check

- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: juno-node@v${{ steps.version_check.outputs.releaseVersion }}

- name: Publish Release
id: create_release
uses: actions/create-release@latest
with:
tag_name: ${{ steps.version_check.outputs.releaseVersion }}
release_name: Linux Release ${{ steps.version_check.outputs.releaseVersion }}
tag_name: v${{ steps.version_check.outputs.releaseVersion }}-beta
release_name: Juno-node@v${{ steps.version_check.outputs.releaseVersion }}-beta
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -96,6 +120,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./juno-node-linux-${{ steps.version_check.outputs.releaseVersion }}-beta.zip
asset_name: juno-node-linux-${{ steps.version_check.outputs.releaseVersion }}-beta.zip
asset_content_type: application/zip
asset_path: juno-node-${{ steps.version_check.outputs.releaseVersion }}.tgz
asset_name: juno-node@v${{ steps.version_check.outputs.releaseVersion }}-beta.tgz
asset_content_type: application/gzip

0 comments on commit f228f8a

Please sign in to comment.