Skip to content

Commit

Permalink
Release via Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
reconman committed Oct 11, 2020
1 parent bb031a0 commit a8b2678
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Build
on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]

Expand All @@ -21,3 +22,51 @@ jobs:
node-version: '13.x'
- run: npm ci
- run: npm run build --if-present
- run: |
cd dist
zip -r ../saltbot.zip *
- name: Upload extension zip
uses: actions/upload-artifact@v1
with:
name: extension
path: saltbot.zip
deploy:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Set tag env var
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Draft Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{env.TAG_VERSION}}
release_name: Release ${{env.TAG_VERSION}}
draft: true

- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: extension
- name: Upload extension to GitHub Releases
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./extension/saltbot.zip
asset_name: saltbot ${{env.TAG_VERSION}}.zip
asset_content_type: application/zip
- name: Publish in Chrome Store
uses: Passiverecords/[email protected]
with:
app-id: 'bholoegapebhflljekancpcnajigaiih'
file-name: './extension/saltbot.zip'
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
refresh-token: ${{ secrets.REFRESH_TOKEN }}
publish: true

0 comments on commit a8b2678

Please sign in to comment.