From 13952fa3180f930caf0905aadfa2498447d386c6 Mon Sep 17 00:00:00 2001 From: Taso Date: Thu, 5 Aug 2021 19:45:05 -0400 Subject: [PATCH] ci(tagged-release): setup sentry deployment with node and mis general cleanup --- .github/workflows/tagged-releases.yml | 65 ++++++++++++++------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tagged-releases.yml b/.github/workflows/tagged-releases.yml index 2311647..543b54d 100644 --- a/.github/workflows/tagged-releases.yml +++ b/.github/workflows/tagged-releases.yml @@ -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/sentry-releases-action@v1.2.0 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/sentry-releases-action@v1.2.0 + 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 }} \ No newline at end of file