Skip to content

Commit

Permalink
Update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackebein committed Jul 29, 2024
1 parent 1e65f60 commit f844116
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build Release
on:
push:
tags:
- "v*.*.*"
- "*.*.*"

jobs:

Expand Down Expand Up @@ -39,9 +39,6 @@ jobs:
# Checkout Local Repository
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
ref: ${{ github.ref }}

# Get the Package version based on the package.json file
- name: Get Version
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Bump Version

on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true

jobs:

# Validate Repository Configuration
config:
runs-on: ubuntu-latest
outputs:
config_package: ${{ steps.config_package.outputs.configPackage }}
steps:

# Ensure that required repository variable has been created for the Package
- name: Validate Package Config
id: config_package
run: |
if [ "${{ vars.PACKAGE_NAME }}" != "" ]; then
echo "configPackage=true" >> $GITHUB_OUTPUT;
else
echo "configPackage=false" >> $GITHUB_OUTPUT;
fi
# Build and release the Package
# If the repository is not configured properly, this job will be skipped
build:
needs: config
runs-on: ubuntu-latest
permissions:
contents: write
#pull-requests: write
env:
packagePath: Packages/${{ vars.PACKAGE_NAME }}
if: needs.config.outputs.config_package == 'true'
steps:

- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0
#token: ${{ secrets.TOKEN }}

- name: Update package.json
uses: jossef/action-set-json-field@890d7642122dbb2833dddd2003659bb71a2b21fe
with:
file: ${{ env.packagePath }}/package.json
field: version
value: ${{ github.event.inputs.version }}

- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Bump version to ${{ github.event.inputs.version }}"
git tag -a ${{ github.event.inputs.version }} -m "Version ${{ github.event.inputs.version }}"
- name: Push changes
uses: ad-m/github-push-action@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa
with:
github_token: ${{ secrets.TOKEN }}
tags: true

0 comments on commit f844116

Please sign in to comment.