-
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Tagged Release Publisher | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
jobs: | ||
create-tagged-release: | ||
name: Build and Create Tagged Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get tag | ||
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//} | ||
id: get_tag | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.ref }} | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18' | ||
check-latest: true | ||
|
||
- name: Run build | ||
run: REACT_APP_VERSION=${{ steps.get_tag.outputs.VERSION_TAG }} yarn build | ||
|
||
- name: Create Sentry Release (NPWD) | ||
run: | | ||
curl -sL https://sentry.io/get-cli/ | bash | ||
export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} | ||
export SENTRY_ORG=project-error | ||
export SENTRY_PROJECT=npwd | ||
export SENTRY_URL=https://sentry.projecterror.dev/ | ||
export VERSION=${{ steps.get_tag.outputs.VERSION_TAG }} | ||
sentry-cli releases new "$VERSION" | ||
sentry-cli releases set-commits "$VERSION" --auto | ||
sentry-cli releases files "$VERSION" upload-sourcemaps resources/html --ext map --url-prefix '~/resources/html' | ||
sentry-cli releases finalize "$VERSION" | ||
sentry-cli releases deploys "$VERSION" new -e production | ||
- name: Bundle built files | ||
run: | | ||
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 | ||
# Make sure we copy our one lua boy | ||
mkdir ./temp/npwd/resources/client | ||
cp ./resources/client/cl_controls.lua ./temp/npwd/resources/client/cl_controls.lua | ||
cd ./temp && zip -r ../npwd.zip ./npwd | ||
- name: Create Release | ||
uses: "marvinpinto/[email protected]" | ||
id: auto_release | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
title: NPWD Release | ${{ steps.get_tag.outputs.VERSION_TAG }} | ||
prerelease: false | ||
files: npwd.zip | ||
|
||
env: | ||
CI: false | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
bump-manifest-version: | ||
name: 'Bump fxmanifest version' | ||
needs: create-tagged-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get tag | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
- name: Bump manifest version | ||
run: node .github/actions/bump-manifest-version.js | ||
env: | ||
TGT_RELEASE_VERSION: ${{ env.RELEASE_VERSION }} | ||
- name: Push manifest change | ||
uses: EndBug/add-and-commit@v8 | ||
with: | ||
add: fxmanifest.lua | ||
push: true | ||
author_name: Manifest Bumper | ||
author_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
message: 'chore(bump-manifest): Bump manifest version to ${{ env.RELEASE_VERSION }}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACTION_SECRET }} |