ci(tagged-release): setup sentry deployment with node

and mis general cleanup
This commit is contained in:
Taso committed 2021-08-05 19:45:29 -04:00
1 parent 95c3aea1d9
commit 13952fa318
1 file changed
+35 -30
+35 -30
View File
@@ -5,66 +5,71 @@ on:
- "v*"
jobs:
create-tagged-release:
name: Build and Create Tagged Release
runs-on: ubuntu-latest
outputs:
VERSION_TAG: ${{ steps.get_vars.outputs.VERSION_TAG }}
steps:
- name: Install archive tools
run: sudo apt-get install zip gzip tar
run: sudo apt install zip
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Get variables
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
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
run: yarn --frozen-lockfile
run: yarn
- name: Run build
run: npm run build
- name: Create Sentry Release
run: yarn build
- name: Create Sentry Release (NPWD)
uses: tclindner/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_ORG: 'project-error'
SENTRY_PROJECT: 'npwd'
SENTRY_URL: https://sentry.projecterror.dev/
with:
environment: production
tagName: ${{ steps.get_vars.outputs.VERSION_TAG }}
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
run: |
mkdir npwd_temp
mkdir npwd_temp/resources
cp -t npwd_temp/resources -r resources/dist resources/html
cp -t npwd_temp fxmanifest.lua config.json LICENSE README.md
zip -r npwd-${{ steps.get_vars.outputs.VERSION_TAG }} npwd_temp
rm -rf npwd_temp
echo "Cleaned up"
mkdir -p ./temp/npwd/resources
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
cp -r ./resources/{dist,html} ./temp/npwd/resources
cd ./temp && zip -r npwd-${{ steps.get_vars.outputs.VERSION_TAG }}.zip ./npwd
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
uses: "marvinpinto/action-automatic-releases@v1.2.1"
id: auto_release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: NPWD Release | ${{ steps.get_vars.outputs.VERSION_TAG }}
prerelease: false
files: |
"npwd-${{ steps.get_vars.outputs.VERSION_TAG }}"
files: npwd-${{ steps.get_vars.outputs.VERSION_TAG }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}