Skip to content

Commit

Permalink
chore(ci): add manual release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dvcol committed Apr 23, 2022
1 parent b3a692d commit 0795125
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 36 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.js.yml
Expand Up @@ -11,6 +11,7 @@ on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

env:
node_version: 16.x
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/publish.js.yml
@@ -0,0 +1,69 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Publish - Package release and publish

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
tags:
# Ignore release candidates
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

env:
node_version: 16.x

jobs:
release:
name: Publish
runs-on: ubuntu-latest

steps:
- name: Checkout branch ${{ github.ref }}
uses: actions/checkout@v3

- name: Setup Node.js ${{ env.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
cache: 'yarn'

- name: Clean install dependencies
run: yarn install

- name: Build application
run: yarn build

- name: Zip build folder
run: |
# Zipping build folder for artifact upload
cd build;
zip -r synology-download.zip *
# Check zip created
echo "Zip created in 'build/'"
ls -l synology-download.zip
cd ..
- name: Generate Release changelog
run: yarn changelog

- name: Push Release to github
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE.md
files: build/synology-download.zip

- name: Publish to Chrome webstore
env:
CHROME_WEB_STORE_EXTENSION_ID: ebbdkledlkjpgbbmmopgbnnjmklnkcef
CHROME_WEB_STORE_CLIENT_ID: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
CHROME_WEB_STORE_CLIENT_SECRET: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
CHROME_WEB_STORE_REFRESH_TOKEN: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}
run: |
# Uploadind zip to web store
yarn dlx -q chrome-webstore-upload-cli upload --source build/synology-download.zip --extension-id "$CHROME_WEB_STORE_EXTENSION_ID" --client-id "$CHROME_WEB_STORE_CLIENT_ID" --client-secret "$CHROME_WEB_STORE_CLIENT_SECRET" --refresh-token "$CHROME_WEB_STORE_REFRESH_TOKEN"
40 changes: 5 additions & 35 deletions .github/workflows/release.js.yml
Expand Up @@ -8,10 +8,7 @@ concurrency:
cancel-in-progress: true

on:
push:
tags:
# Ignore release candidates
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

env:
node_version: 16.x
Expand All @@ -34,35 +31,8 @@ jobs:
- name: Clean install dependencies
run: yarn install

- name: Build application
run: yarn build
- name: Release
run: yarn release

- name: Zip build folder
run: |
# Zipping build folder for artifact upload
cd build;
zip -r synology-download.zip *
# Check zip created
echo "Zip created in 'build/'"
ls -l synology-download.zip
cd ..
- name: Generate Release changelog
run: yarn changelog

- name: Push Release to github
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE.md
files: build/synology-download.zip

- name: Publish to Chrome webstore
env:
CHROME_WEB_STORE_EXTENSION_ID: ebbdkledlkjpgbbmmopgbnnjmklnkcef
CHROME_WEB_STORE_CLIENT_ID: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
CHROME_WEB_STORE_CLIENT_SECRET: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
CHROME_WEB_STORE_REFRESH_TOKEN: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}
run: |
# Uploadind zip to web store
yarn dlx -q chrome-webstore-upload-cli upload --source build/synology-download.zip --extension-id "$CHROME_WEB_STORE_EXTENSION_ID" --client-id "$CHROME_WEB_STORE_CLIENT_ID" --client-secret "$CHROME_WEB_STORE_CLIENT_SECRET" --refresh-token "$CHROME_WEB_STORE_REFRESH_TOKEN"
- name: Push to remote
run: git push origin --follow-tags
3 changes: 2 additions & 1 deletion .github/workflows/version.js.yml
Expand Up @@ -10,6 +10,7 @@ concurrency:
on:
push:
branches: [ main ]
workflow_dispatch:

env:
node_version: 16.x
Expand All @@ -18,7 +19,7 @@ jobs:
version:
name: Bump version
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'chore(release)') && !contains(github.event.head_commit.message, 'chore(version)')"
if: "!contains(github.event.head_commit.message, 'chore')"

env:
old_version: ''
Expand Down

0 comments on commit 0795125

Please sign in to comment.