mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
ci(create-release): use github app token
This commit is contained in:
64
.github/workflows/release.yml
vendored
64
.github/workflows/release.yml
vendored
@@ -7,26 +7,39 @@ on:
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
if: github.actor_id != 210085057
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get latest code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.repository.default_branch }}
|
||||
- name: Install zip
|
||||
run: sudo apt install zip
|
||||
|
||||
- name: Setup Bun
|
||||
- name: Install Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
|
||||
- name: Generate GitHub App token
|
||||
id: app_token
|
||||
uses: tibdex/github-app-token@v2
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Get latest code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.repository.default_branch }}
|
||||
token: ${{ steps.app_token.outputs.token }}
|
||||
|
||||
|
||||
- name: Install package dependencies
|
||||
run: bun install
|
||||
run: bun install --frozen-lockfile
|
||||
working-directory: package
|
||||
|
||||
- name: Install web dependencies
|
||||
run: bun install
|
||||
run: bun install --frozen-lockfile
|
||||
working-directory: web
|
||||
|
||||
- name: Run web build script
|
||||
@@ -35,16 +48,15 @@ jobs:
|
||||
|
||||
|
||||
- name: Bump package version
|
||||
run: bun .github/actions/bump-package-version.js
|
||||
run: bun run .github/actions/bump-package-version.js
|
||||
env:
|
||||
TGT_RELEASE_VERSION: ${{ github.ref_name }}
|
||||
|
||||
- name: Bump manifest version
|
||||
run: bun .github/actions/bump-manifest-version.js
|
||||
run: bun run .github/actions/bump-manifest-version.js
|
||||
env:
|
||||
TGT_RELEASE_VERSION: ${{ github.ref_name }}
|
||||
|
||||
|
||||
- name: Push version bump change
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
@@ -53,25 +65,10 @@ jobs:
|
||||
default_author: github_actions
|
||||
message: 'chore: bump version to ${{ github.ref_name }}'
|
||||
|
||||
- name: Update tag
|
||||
uses: EndBug/latest-tag@v1
|
||||
with:
|
||||
ref: ${{ github.ref_name }}
|
||||
|
||||
|
||||
- name: Publish package to npm registry
|
||||
run: bun publish --access public
|
||||
working-directory: package
|
||||
env:
|
||||
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Install zip
|
||||
run: sudo apt install zip
|
||||
|
||||
- name: Bundle files
|
||||
run: |
|
||||
mkdir -p ./temp/ox_lib
|
||||
mkdir -p ./temp/ox_lib/web/
|
||||
mkdir -p ./temp/ox_lib/web
|
||||
cp ./{LICENSE,README.md,fxmanifest.lua,init.lua} ./temp/ox_lib
|
||||
cp -r ./{imports,resource,locales} ./temp/ox_lib
|
||||
cp -r ./web/build ./temp/ox_lib/web/
|
||||
@@ -79,11 +76,18 @@ jobs:
|
||||
|
||||
- name: Create release
|
||||
uses: 'marvinpinto/action-automatic-releases@v1.2.1'
|
||||
id: auto_release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
prerelease: false
|
||||
files: ox_lib.zip
|
||||
|
||||
- name: Update tag
|
||||
uses: EndBug/latest-tag@v1
|
||||
with:
|
||||
ref: ${{ github.ref_name }}
|
||||
|
||||
- name: Publish package to npm registry
|
||||
run: bun publish --access public
|
||||
working-directory: package
|
||||
env:
|
||||
CI: false
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user