Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Commit a8b2678

Browse files
committed
Release via Github Actions
1 parent bb031a0 commit a8b2678

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name: Build
66
on:
77
push:
88
branches: [ master ]
9+
tags: [ '*' ]
910
pull_request:
1011
branches: [ master ]
1112

@@ -21,3 +22,51 @@ jobs:
2122
node-version: '13.x'
2223
- run: npm ci
2324
- run: npm run build --if-present
25+
- run: |
26+
cd dist
27+
zip -r ../saltbot.zip *
28+
- name: Upload extension zip
29+
uses: actions/upload-artifact@v1
30+
with:
31+
name: extension
32+
path: saltbot.zip
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
if: startsWith(github.ref, 'refs/tags/')
37+
steps:
38+
- name: Set tag env var
39+
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
40+
41+
- name: Draft Release
42+
id: create_release
43+
uses: actions/create-release@latest
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tag_name: ${{env.TAG_VERSION}}
48+
release_name: Release ${{env.TAG_VERSION}}
49+
draft: true
50+
51+
- name: Download Artifact
52+
uses: actions/download-artifact@v1
53+
with:
54+
name: extension
55+
- name: Upload extension to GitHub Releases
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: ./extension/saltbot.zip
62+
asset_name: saltbot ${{env.TAG_VERSION}}.zip
63+
asset_content_type: application/zip
64+
- name: Publish in Chrome Store
65+
uses: Passiverecords/chrome-extension-upload-action@1.4.1
66+
with:
67+
app-id: 'bholoegapebhflljekancpcnajigaiih'
68+
file-name: './extension/saltbot.zip'
69+
client-id: ${{ secrets.CLIENT_ID }}
70+
client-secret: ${{ secrets.CLIENT_SECRET }}
71+
refresh-token: ${{ secrets.REFRESH_TOKEN }}
72+
publish: true

0 commit comments

Comments
 (0)