Skip to content

Commit

Permalink
Add new workflows in GH
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed Oct 18, 2023
1 parent b37495d commit cccdcc6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/create_webclient_alpha_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ALPHA - Create PR on WebClient

on:
release:
types: [published]
workflow_dispatch:

jobs:
create-pr:
if: github.event.release.prerelease == true && contains(github.event.release.tag_name, '-alpha.')
runs-on: ubuntu-latest

steps:
- name: Checkout webclient repository
uses: actions/checkout@v2
with:
repository: 'gisce/webclient'
ref: alpha
token: ${{ secrets.GH_PAT }}

- name: Update library version in package.json
run: |
NEW_VERSION=${{ github.event.release.tag_name }}
NEW_VERSION=${NEW_VERSION#v} # Remove the leading 'v'
sed -i 's|"@gisce/powerp.js": "[^"]*"|"@gisce/powerp.js": "'"$NEW_VERSION"'"|' package.json
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.5.0'

- name: Install npm dependencies and generate package-lock.json
run: |
npm install
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GH_PAT }}
commit-message: "fix: Update @gisce/powerp.js to ${{ github.event.release.tag_name }}"
title: "Update @gisce/powerp.js to ${{ github.event.release.tag_name }}"
branch: "update-powerpjs-${{ github.event.release.tag_name }}"
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
# - main
# - develop
- alpha
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Install Dependencies
run: npm ci

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

0 comments on commit cccdcc6

Please sign in to comment.