mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
ci(tagged-release): setup sentry deployment with node
and mis general cleanup
This commit is contained in:
1 parent
95c3aea1d9
commit
13952fa318
1 file changed
+35
-30
@@ -5,66 +5,71 @@ on:
|
|||||||
- "v*"
|
- "v*"
|
||||||
jobs:
|
jobs:
|
||||||
create-tagged-release:
|
create-tagged-release:
|
||||||
|
name: Build and Create Tagged Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
VERSION_TAG: ${{ steps.get_vars.outputs.VERSION_TAG }}
|
VERSION_TAG: ${{ steps.get_vars.outputs.VERSION_TAG }}
|
||||||
steps:
|
steps:
|
||||||
- name: Install archive tools
|
- name: Install archive tools
|
||||||
run: sudo apt-get install zip gzip tar
|
run: sudo apt install zip
|
||||||
|
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
- name: Get variables
|
- name: Get variables
|
||||||
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
|
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
|
||||||
id: get_vars
|
id: get_vars
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
- name: Use Node.js
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '14.x'
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn --frozen-lockfile
|
run: yarn
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
run: npm run build
|
run: yarn build
|
||||||
- name: Create Sentry Release
|
|
||||||
|
- name: Create Sentry Release (NPWD)
|
||||||
uses: tclindner/[email protected]
|
uses: tclindner/[email protected]
|
||||||
env:
|
env:
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
SENTRY_ORG: 'project-error'
|
||||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
SENTRY_PROJECT: 'npwd'
|
||||||
SENTRY_URL: https://sentry.projecterror.dev/
|
SENTRY_URL: https://sentry.projecterror.dev/
|
||||||
with:
|
with:
|
||||||
environment: production
|
environment: production
|
||||||
tagName: ${{ steps.get_vars.outputs.VERSION_TAG }}
|
tagName: ${{ steps.get_vars.outputs.VERSION_TAG }}
|
||||||
sourceMapOptions: './resources/html/static/js'
|
sourceMapOptions: './resources/html/static/js'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create Sentry Release (NodeJS)
|
||||||
|
uses: tclindner/[email protected]
|
||||||
|
env:
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
SENTRY_ORG: 'project-error'
|
||||||
|
SENTRY_PROJECT: 'npwd-s'
|
||||||
|
SENTRY_URL: https://sentry.projecterror.dev/
|
||||||
|
with:
|
||||||
|
environment: production
|
||||||
|
tagName: ${{ steps.get_vars.outputs.VERSION_TAG }}
|
||||||
|
sourceMapOptions: './resources/html/static/js'
|
||||||
|
|
||||||
- name: Bundle built files
|
- name: Bundle built files
|
||||||
run: |
|
run: |
|
||||||
mkdir npwd_temp
|
mkdir -p ./temp/npwd/resources
|
||||||
mkdir npwd_temp/resources
|
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
|
||||||
cp -t npwd_temp/resources -r resources/dist resources/html
|
cp -r ./resources/{dist,html} ./temp/npwd/resources
|
||||||
cp -t npwd_temp fxmanifest.lua config.json LICENSE README.md
|
cd ./temp && zip -r npwd-${{ steps.get_vars.outputs.VERSION_TAG }}.zip ./npwd
|
||||||
zip -r npwd-${{ steps.get_vars.outputs.VERSION_TAG }} npwd_temp
|
|
||||||
rm -rf npwd_temp
|
|
||||||
echo "Cleaned up"
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
uses: "marvinpinto/action-automatic-releases@v1.2.1"
|
||||||
id: auto_release
|
id: auto_release
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
title: NPWD Release | ${{ steps.get_vars.outputs.VERSION_TAG }}
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: |
|
files: npwd-${{ steps.get_vars.outputs.VERSION_TAG }}.zip
|
||||||
"npwd-${{ steps.get_vars.outputs.VERSION_TAG }}"
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
Reference in new issue
Block a user