Skip to content

Commit

Permalink
Try Update GH Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisCris committed Apr 26, 2024
1 parent f66dc66 commit d58dcc1
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Dev Release
name: Dev Build

on:
push:
branches-ignore:
- release

on: [push]
jobs:
dev-release:
strategy:
Expand All @@ -13,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12.2
architecture: x64
Expand All @@ -34,7 +38,7 @@ jobs:
run: ./build_executable.sh

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Palworld_Pal_Editor_${{ matrix.os }}_artifact
path: ./dist/
path: ./dist/
54 changes: 54 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release Build

on:
push:
branches:
- release
tags:
- "v*.*.*"

jobs:
dev-release:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12.2
architecture: x64

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Run Windows Builder Script
if: runner.os == 'Windows'
shell: pwsh
run: ./build_executable.ps1

- name: Run Unix-like Builder Script
if: runner.os != 'Windows'
shell: bash
run: ./build_executable.sh

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Palworld_Pal_Editor_${{ matrix.os }}_artifact
path: ./dist/

- name: Create and Upload Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/release-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Push Docker image

on:
push:
branches:
- release
tags:
- "v*.*.*"

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase repository owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/${{ env.REPO_OWNER }}/palworld-pal-editor:latest
platforms: linux/amd64,linux/arm64

- name: Verify image digest
run: echo "The new image digest is ${{ steps.build-and-push.outputs.digest }}"

0 comments on commit d58dcc1

Please sign in to comment.