Skip to content

Update .release-version #907

Update .release-version

Update .release-version #907

# Automatically generate a release on develop and master
name: Automated release and build of project
on:
push:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nelonoel/[email protected]
- name: Set release tag
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
# On the develop branch this might create RELEASE_VERSION=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_VERSION=2.4.6
run: echo "RELEASE_VERSION=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install
run: >-
npm ci --legacy-peer-deps
- name: Compile Build
run: >-
./compile-build.sh release.tar.gz dist
- name: Create release and upload release.tar.gz
uses: ncipollo/[email protected]
with:
name: ${{ env.RELEASE_VERSION }}
tag: v${{ env.RELEASE_VERSION }}
prerelease: ${{ !(github.ref == 'refs/heads/master') }}
commit: ${{ github.sha }}
artifacts: release.tar.gz
artifactErrorsFailBuild: true