Skip to content

Commit

Permalink
ci(nightly): run new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Nov 5, 2023
1 parent 3425668 commit 8c48af6
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 39 deletions.
98 changes: 91 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ permissions:
actions: write
deployments: write
pull-requests: read


on:
push:
Expand All @@ -15,18 +14,103 @@ on:

jobs:
create-nightly-release:
name: Create Nightly relesae
name: Create Nightly release
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get tag
uses: project-error/get-tag@v1.0
uses: project-error/get-tag@v1.2
with:
environment: "dev"
prerelease: true
id: get_tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Output releas tag
run: echo "New release tag ${{ steps.get_tag.outputs.release_tag }}"


- name: Bump manifest version
run: node .github/actions/bump-manifest-version.js
env:
TGT_RELEASE_VERSION: ${{ steps.get_tag.outputs.release_tag }}

- 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 version to nightly ${{ steps.get_tag.outputs.release_tag }}"


# super hacky
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 7.29.1
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Run build
run: REACT_APP_VERSION=${{ steps.get_tag.outputs.release_tag }} pnpm 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/dist
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
cp -r ./dist/{game,html} ./temp/npwd/dist
cd ./temp && zip -r ../npwd.zip ./npwd
- name: Create Release
uses: "project-error/[email protected]"
id: auto_release
with:
environment: "dev"
title: NPWD Nightly ${{ steps.get_tag.outputs.release_tag }}
prerelease: true
automatic_release_tag: ${{ steps.get_tag.outputs.release_tag }}
files: npwd.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/project-error/npwd/releases/${{ steps.auto_release.outputs.release_id }}/assets?name=npwd.zip" \
--data-binary "@npwd.zip"
37 changes: 29 additions & 8 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
name: Nightly release

on:
workflow_dispatch:
permissions:
id-token: write
contents: write
actions: write
deployments: write
pull-requests: read


jobs:
create-nightly-release:
name: Create nightly release
name: Create Nightly release
runs-on: ubuntu-latest

steps:
- name: Get tag
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
uses: project-error/[email protected]
with:
environment: "dev"
prerelease: true
id: get_tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Bump manifest version
run: node .github/actions/bump-manifest-version.js
env:
TGT_RELEASE_VERSION: ${{ steps.get_tag.outputs.release_tag }}

- name: Get new tag
id: get_new_tag
- 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 version to nightly ${{ steps.get_tag.outputs.release_tag }}"

- name: Checkout source code
uses: actions/checkout@v4
Expand All @@ -34,7 +55,7 @@ jobs:
run: pnpm i --frozen-lockfile

- name: Run build
run: REACT_APP_VERSION=${{ steps.get_tag.outputs.VERSION_TAG }} pnpm build
run: REACT_APP_VERSION=${{ steps.get_tag.outputs.release_tag }} pnpm build

#- name: Create Sentry Release (NPWD)
# run: |
Expand Down Expand Up @@ -65,7 +86,7 @@ jobs:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: NPWD Nightly
prerelease: true
automatic_release_tag: "latest"
automatic_release_tag: ${{ steps.get_tag.outputs.release_tag }}
files: npwd.zip

env:
Expand Down
56 changes: 33 additions & 23 deletions .github/workflows/tagged-releases.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Tagged Release Publisher

on:
workflow_dispatch:

Expand All @@ -8,14 +9,41 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get tag
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
uses: project-error/[email protected]
with:
environment: "dev"
prerelease: true
id: get_tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Bump manifest version
run: node .github/actions/bump-manifest-version.js
env:
TGT_RELEASE_VERSION: ${{ steps.get_tag.outputs.release_tag }}

- 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 version to nightly ${{ steps.get_tag.outputs.release_tag }}"

# super hacky
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.repository.default_branch }}

- name: Install pnpm
uses: pnpm/[email protected]
with:
Expand All @@ -30,25 +58,6 @@ jobs:

- name: Run build
run: REACT_APP_VERSION=${{ steps.get_tag.outputs.VERSION_TAG }} pnpm build

- name: Bump manifest version
run: node .github/actions/bump-manifest-version.js
env:
TGT_RELEASE_VERSION: ${{ github.ref_name }}

- 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 version to ${{ github.ref_name }}"

- name: Update tag ref
uses: EndBug/latest-tag@latest
with:
tag-name: ${{ github.ref_name }}

#- name: Create Sentry Release (NPWD)
# run: |
Expand Down Expand Up @@ -77,8 +86,9 @@ jobs:
id: auto_release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: NPWD Release | ${{ steps.get_tag.outputs.VERSION_TAG }}
title: NPWD Release ${{ steps.get_tag.outputs.release_tag }}
prerelease: false
automatic_release_tag: ${{ steps.get_tag.outputs.release_tag }}
files: npwd.zip

env:
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version("cerulean")
game("gta5")
description("js runtime monkaW")
authors({ "itschip", "erik-sn", "TasoOneAsia", "kidz", "RockySouthpaw", "SamShanks", "c-wide", "mojito" })
version("v1.8.3")
version("1.8.4-beta.20231105.7")
client_scripts({
"dist/game/client/client.js",
"dist/game/client/*.lua",
Expand Down

0 comments on commit 8c48af6

Please sign in to comment.