Skip to content

Commit

Permalink
ci: refactor release build
Browse files Browse the repository at this point in the history
  • Loading branch information
reey committed Jan 18, 2025
1 parent 96a4617 commit 009f39c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 32 deletions.
61 changes: 33 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,45 @@ on:
- beta
- '*.x'
- '*.*.x'
release:
types:
- created

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
new-version: ${{ steps.new-version.outputs.version }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Save new version
id: new-version
run: |
echo "version=$(npm pkg get version | xargs)" >> $GITHUB_OUTPUT
build:
if: github.event_name == 'release'
needs: [release]
name: Build
runs-on: ubuntu-latest
timeout-minutes: 8
Expand All @@ -27,6 +54,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: v${{ needs.release.outputs.new-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -54,29 +82,6 @@ jobs:
with:
prerelease: false
generate_release_notes: false
tag_name: v${{ needs.release.outputs.new-version }}
files: |
./dist/sag-ps-iot-pkg-webrtc-webcam-plugin.zip
release:
if: github.event_name == 'push'
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
2 changes: 1 addition & 1 deletion cumulocity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { version, name, license, author } from './package.json';
export default {
runTime: {
version,
name,
name: 'WebRTC Webcam Plugin',
contextPath: 'sag-ps-iot-pkg-webrtc-webcam-plugin',
key: 'sag-ps-iot-pkg-webrtc-webcam-plugin-application-key',
dynamicOptionsUrl: true,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "WebRTC Webcam Plugin",
"name": "webrtc-webcam-plugin",
"version": "2.0.1",
"scripts": {
"start:shell": "ng serve --shell devicemanagement",
Expand Down

0 comments on commit 009f39c

Please sign in to comment.