Skip to content

Commit

Permalink
Feat: release dev workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Oct 5, 2023
1 parent 954c0aa commit 9b6fa22
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 29 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Build
name: build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
build:
Expand All @@ -17,10 +13,9 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand All @@ -32,21 +27,9 @@ jobs:
npm install
npm run build
- name: Create dist.zip
if: ${{ startsWith( matrix.node-version, '18') }}
run: zip -r dist.zip dist

- name: Create dist.tar.gz
if: ${{ startsWith( matrix.node-version, '18') }}
run: tar -zcvf dist.tar.gz dist

- uses: "marvinpinto/action-automatic-releases@latest"
- name: Upload artifact
uses: actions/upload-artifact@v3
if: ${{ startsWith( matrix.node-version, '18') }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev"
title: "Dev Build"
prerelease: true
files: |
dist.zip
dist.tar.gz
name: synctv-web
path: dist
8 changes: 2 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Release
name: release

on:
push:
Expand All @@ -15,10 +12,9 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release_dev

on:
workflow_dispatch:

jobs:
release_dev:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
npm install
npm run build
- name: Create dist.zip
run: zip -r dist.zip dist

- name: Create dist.tar.gz
run: tar -zcvf dist.tar.gz dist

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev"
title: "Dev Build"
prerelease: true
files: |
dist.zip
dist.tar.gz

0 comments on commit 9b6fa22

Please sign in to comment.