-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(github): use supported actions
- Loading branch information
Showing
1 changed file
with
60 additions
and
48 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 |
---|---|---|
|
@@ -11,56 +11,68 @@ jobs: | |
name: "Create Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.repository.default_branch }} | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.repository.default_branch }} | ||
|
||
- name: Get the latest tag | ||
id: get_tag | ||
run: echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV | ||
- name: Get the latest tag | ||
id: get_tag | ||
run: | | ||
echo "LATEST_TAG=$(git tag --sort=-creatordate | head -n 1)" >> $GITHUB_ENV | ||
- name: Install ZIP | ||
run: sudo apt install zip | ||
- name: Install ZIP | ||
run: sudo apt install zip | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 9 | ||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 9 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: "pnpm" | ||
cache-dependency-path: "web/pnpm-lock.yaml" | ||
|
||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
working-directory: web | ||
|
||
- name: Run build | ||
run: pnpm build | ||
working-directory: web | ||
env: | ||
CI: false | ||
|
||
- name: Bundle files | ||
run: | | ||
shopt -s extglob | ||
mkdir -p ./temp/${{ github.event.repository.name }} | ||
mkdir -p ./temp/${{ github.event.repository.name }}/web | ||
cp ./{README.md,LICENSE,config.lua,fxmanifest.lua} ./temp/${{ github.event.repository.name }} | ||
cp -r ./{client,locales,server} ./temp/${{ github.event.repository.name }} | ||
cp -r ./web/public ./temp/${{ github.event.repository.name }}/web/public | ||
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }} | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: "pnpm" | ||
cache-dependency-path: "web/pnpm-lock.yaml" | ||
|
||
- name: Create Release | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
title: ${{ env.LATEST_TAG }} | ||
repo_token: '${{ secrets.GITHUB_TOKEN }}' | ||
prerelease: false | ||
automatic_release_tag: ${{ env.LATEST_TAG }} | ||
files: ${{ github.event.repository.name }}.zip | ||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
working-directory: web | ||
|
||
- name: Run build | ||
run: pnpm build | ||
working-directory: web | ||
env: | ||
CI: false | ||
|
||
- name: Bundle files | ||
run: | | ||
shopt -s extglob | ||
mkdir -p ./temp/${{ github.event.repository.name }} | ||
mkdir -p ./temp/${{ github.event.repository.name }}/web | ||
cp ./{README.md,LICENSE,config.lua,fxmanifest.lua} ./temp/${{ github.event.repository.name }} | ||
cp -r ./{client,locales,server} ./temp/${{ github.event.repository.name }} | ||
cp -r ./web/public ./temp/${{ github.event.repository.name }}/web/public | ||
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }} | ||
- name: Update CHANGELOG | ||
id: changelog | ||
uses: requarks/changelog-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ env.LATEST_TAG }} | ||
writeToFile: false | ||
|
||
- name: Create Release | ||
uses: ncipollo/[email protected] | ||
with: | ||
allowUpdates: true | ||
draft: false | ||
makeLatest: true | ||
name: ${{ env.LATEST_TAG }} | ||
tag: ${{ env.LATEST_TAG }} | ||
body: ${{ steps.changelog.outputs.changes }} | ||
artifacts: ${{ github.event.repository.name }}.zip | ||
token: ${{ secrets.GITHUB_TOKEN }} |