Skip to content

Commit

Permalink
upd deploy configs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCat committed Nov 16, 2023
1 parent 7a74709 commit 2bee9a1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 59 deletions.
81 changes: 23 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,50 @@
name: Release Build
name: Testing Build

on:
push:
branches: [master]
branches: [testing]

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Get version value, set to env
run: echo "PACKAGE_VERSION=v$(awk -F\" '/"version":/ {print $4}' package.json)" >> $GITHUB_ENV

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.PACKAGE_VERSION }}
release_name: Aurora Launcher ${{ env.PACKAGE_VERSION }}

outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}

build:
runs-on: ${{ matrix.os }}
needs: release

strategy:
matrix:
include:
- os: ubuntu-latest
build_os: 'linux'
- os: windows-latest
build_os: 'win32'
- os: macos-latest
build_os: 'darwin'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Download dependencies
run: npm ci
run: npm i

- name: Build Launcher
run: npm run build

- name: Copy package.json
run: cp src/package.json build/package.json

- name: Pack Launcher
run: npm run pack

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: Launcher ${{ matrix.build_os }}
path: aurora-launcher-${{ matrix.build_os }}-x64
if-no-files-found: error
retention-days: 30

- name: Create release archive
uses: papeloto/action-zip@v1
with:
files: aurora-launcher-${{ matrix.build_os }}-x64
dest: ${{ matrix.build_os }}.zip

- name: Upload release
uses: actions/upload-release-asset@v1
- name: Pack and publish Launcher
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./${{ matrix.build_os }}.zip
asset_name: Launcher_${{ matrix.os }}.zip
asset_content_type: application/zip
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
EP_DRAFT: true
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
"bucket": "1d9331f7-f396817b-b981-4ede-980b-acfe89b8ba52",
"endpoint": "https://s3.timeweb.com"
},
"github"
{
"provider": "github",
"releaseType": "release"
}
],
"directories": {
"buildResources": "resources"
Expand Down

0 comments on commit 2bee9a1

Please sign in to comment.