Skip to content

Commit

Permalink
* chore(actions): created action for automatic versioning and release
Browse files Browse the repository at this point in the history
* chore(actions): created action for automatic versioning and release

* Update node.js.yml

* chore(github-action): changed run command to the deployBuild script

* fix(github-action): added npm install step

* chore(github-action): try to fix file not found error

* chore(github-action): try to fix file not found error

* chore(deploy-script): replaced fixed strings with path variables

* chore(deploy-script): fixed lower case letters, for unix environments

* chore(github-action): added user.name and email to workflow

* chore(github-action): removed pull-requests as they not build releases

* chore(github-action): fixed a better version tagging

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* Update check_version_readout.js.yml

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): get auto pre-release working

* chore(github-action): for testing added pull-request to pre-release build script

* chore(github-action): try to get the version right

* chore(github-action): try getting artifact upload correct

* Update node.js.yml

* Update node.js.yml

* Update node.js.yml

* Update node.js.yml

* chore: update node.js.yml

Added some more conditionals and filters to prevent unnecessary releases

* chore: update node.js.yml

fixed typo

* chore: update node.js.yml

fix version update push

* chore: update node.js.yml

get push fixed

* Update node.js.yml

* Update node.js.yml

* Update node.js.yml

* Update node.js.yml

* Update node.js.yml
  • Loading branch information
tabris87 authored Mar 1, 2024
1 parent cfced7b commit f345f61
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 19 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/check_version_readout.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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: Check Version

on:
pull_request:
branches:
- "develop"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
- name: Set release version
id: set_version
run: |
echo "version=$(cat package.json | grep -sw '"\bversion\b"' | cut -d '"' -f 4)_nightly" >> "$GITHUB_ENV"
- name: Read release version
id: read_version
run: |
echo "$version"
55 changes: 36 additions & 19 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,62 @@
# 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: Node.js CI
name: Create Nightly Release

on:
push:
branches: ["develop"]

branches:
- develop
paths:
- 'webapp/**'
jobs:
build:
build-and-release:
if: "!startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'ci')"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
- run: npm ci
- name: Install dependencies
run: npm ci
- name: Configure committer
run: |
git config user.name "Github Actions Bot"
git config user.email "<>"
- run: npm run changelog
- run: npm run deployBuild -- --pre
git config user.name "UI5 journey recorder bot"
git config user.email "[email protected]"
- name: Create changelog and increase version
run: npm run changelog -- --prerelease nightly
- name: Build the extension for deploy
run: npm run deployBuild -- --pre
working-directory: ${{ github.workspace }}
- name: Set release names
id: set_names
- name: Extract versions
id: version_extract
run: |
echo "version=$(cat package.json | grep -sw '"\bversion\b"' | cut -d '"' -f 4)_nightly" >> "$GITHUB_ENV"
- name: Create Pre Release
id: create_pre_release
echo "VERSION=$(cat package.json | grep -sw '"\bversion\b"' | cut -d '"' -f 4)" >> "$GITHUB_ENV"
echo "FILE_VERSION=$(cat package.json | grep -sw '"\bversion\b"' | cut -d '"' -f 4 | sed "s/\./\-/g")" >> "$GITHUB_ENV"
- name: Push version and changlog
run: git push --follow-tags origin develop
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{version}}
release_name: Pre-Release ${{version}}
tag_name: ${{ env.VERSION }}_nightly
release_name: Nightly-Release $env.version
body: |
Automatic generated pre-release with the latest features and bugfixes
Automatic generated nightly release with the latest features and bugfixes
draft: false
prerelease: true
path: deployments/journey_recorder_nightly_${{version}}.zip
- name: Upload release artifact
id: upload_release_artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./deployments/journey_recorder_nightly_${{ env.FILE_VERSION }}.zip
asset_name: journey_recorder_nightly_${{ env.FILE_VERSION }}.zip
asset_content_type: application/zip

0 comments on commit f345f61

Please sign in to comment.