From 17f831e8a2e7ec0ea83cb6a2db06412fe2027c06 Mon Sep 17 00:00:00 2001 From: Tommy Mikkelsen Date: Wed, 23 Nov 2022 23:01:06 +0100 Subject: [PATCH] Allow alpha builds --- .github/workflows/alpha-build.yml | 48 +++++++++++++++++++++++++++++++ script/alpha.sh | 21 ++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/alpha-build.yml create mode 100644 script/alpha.sh diff --git a/.github/workflows/alpha-build.yml b/.github/workflows/alpha-build.yml new file mode 100644 index 0000000..740b414 --- /dev/null +++ b/.github/workflows/alpha-build.yml @@ -0,0 +1,48 @@ +name: Build/release + +on: + push: + branches: + - alpha + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] +# os: [macos-latest] +# os: [ubuntu-latest, windows-latest] +# os: [windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + - name: Setup Node.js + uses: actions/setup-node@master + with: + node-version: 16.13 + - name: Install dependencies + run: npm install + - name: see directory with dependencies + run: ls + - name: Add TMDB Secret + run: echo "${{ secrets.KEY_TMDB }}" > public/locales/.env.local + shell: bash + env: + KEY_TMDB: ${{ secrets.KEY_TMDB }} + - name: Add TVDB Secret + run: echo "${{ secrets.KEY_TVDB }}" >> public/locales/.env.local + shell: bash + env: + KEY_TVDB: ${{ secrets.KEY_TVDB }} + - name: Add POEditor Secret + run: echo "${{ secrets.KEY_POEDITOR }}" >> public/locales/.env.local + shell: bash + env: + KEY_POEDITOR: ${{ secrets.KEY_POEDITOR }} + - name: Deploy Releases + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npm run deploy diff --git a/script/alpha.sh b/script/alpha.sh new file mode 100644 index 0000000..91c99f8 --- /dev/null +++ b/script/alpha.sh @@ -0,0 +1,21 @@ +# Release from alpha into a draft release + + +# Checkout Alpha Branch +git checkout alpha + +# Get current version +CURVER=$(cat package.json|grep -oP '(?<="version": ")[^"]*') +echo $CURVER +# Get git root directory +root=$(git rev-parse --show-toplevel 2>&1) +# get commit hash for version file +rev=$(git rev-parse --short HEAD 2>&1) +echo Committing v$CURVER.$rev +# Commit to alpha Branch +git commit -am v$CURVER.$rev +# Tag alpha Branch +git tag v$CURVER.$rev +# Upload and trigger a release +git push && git push --tags +git checkout $CURBRANCH