mirror of
https://gitea.shironeko-all.duckdns.org/shironeko/Hytale-F2P-2.git
synced 2026-02-26 02:31:46 -03:00
test: release on main branch using tag
This commit is contained in:
230
.github/workflows/release.yml
vendored
230
.github/workflows/release.yml
vendored
@@ -3,122 +3,194 @@ name: Build and Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release
|
- main
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform: linux
|
||||||
|
- os: windows-latest
|
||||||
|
platform: win
|
||||||
|
- os: macos-latest
|
||||||
|
platform: mac
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# Not needed anymore due to the removal of Pacman builds
|
|
||||||
# - name: Install build dependencies
|
|
||||||
# run: |
|
|
||||||
# sudo apt-get update
|
|
||||||
# sudo apt-get install -y libarchive-tools
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
- name: Build Linux Packages
|
- name: Build for ${{ matrix.os }}
|
||||||
run: |
|
run: npm run build:${{ matrix.platform }}
|
||||||
npx electron-builder --linux --x64 --arm64 --publish never
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Upload Artifacts for ${{ matrix.os }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: linux-builds
|
name: ${{ matrix.os }}-builds
|
||||||
path: |
|
path: |
|
||||||
|
dist/*.exe
|
||||||
|
dist/*.exe.blockmap
|
||||||
|
dist/*.dmg
|
||||||
|
dist/*.zip
|
||||||
dist/*.AppImage
|
dist/*.AppImage
|
||||||
dist/*.AppImage.blockmap
|
dist/*.AppImage.blockmap
|
||||||
dist/*.deb
|
dist/*.deb
|
||||||
dist/*.rpm
|
dist/*.rpm
|
||||||
dist/*.pkg.tar.zst
|
dist/*.pkg.tar.zst
|
||||||
dist/latest-linux.yml
|
dist/latest*.yml
|
||||||
|
|
||||||
build-windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '22'
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- name: Build Windows Packages
|
|
||||||
run: npx electron-builder --win --publish never
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: windows-builds
|
|
||||||
path: |
|
|
||||||
dist/*.exe
|
|
||||||
dist/*.exe.blockmap
|
|
||||||
dist/latest.yml
|
|
||||||
|
|
||||||
build-macos:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '22'
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- name: Build macOS Packages
|
|
||||||
run: npx electron-builder --mac --publish never
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: macos-builds
|
|
||||||
path: |
|
|
||||||
dist/*.dmg
|
|
||||||
dist/*.zip
|
|
||||||
dist/latest-mac.yml
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build-linux, build-windows, build-macos]
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: |
|
if: |
|
||||||
startsWith(github.ref, 'refs/tags/v') ||
|
startsWith(github.ref, 'refs/tags/v')
|
||||||
github.ref == 'refs/heads/release' ||
|
|
||||||
github.event_name == 'workflow_dispatch'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# FIX: './package.json' Module Not Found in `Get version` step
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
merge-multiple: true
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -R artifacts
|
run: ls -R artifacts
|
||||||
|
|
||||||
- name: Get version from package.json
|
- name: Get version from package.json
|
||||||
id: pkg_version
|
id: pkg_version
|
||||||
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
# If it's a tag, use the tag.
|
|
||||||
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}.r{1}', steps.pkg_version.outputs.VERSION, github.run_number) }}
|
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}.r{1}', steps.pkg_version.outputs.VERSION, github.run_number) }}
|
||||||
# If it's the 'release' branch, use 'v2.0.2-beta.r42'
|
|
||||||
name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}-beta.r{1}', steps.pkg_version.outputs.VERSION, github.run_number) }}
|
|
||||||
files: |
|
files: |
|
||||||
artifacts/linux-builds/**/*
|
artifacts/ubuntu-latest-builds/**/*
|
||||||
artifacts/windows-builds/**/*
|
artifacts/windows-latest-builds/**/*
|
||||||
artifacts/macos-builds/**/*
|
artifacts/macos-latest-builds/**/*
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
draft: true
|
draft: true
|
||||||
# DYNAMIC FLAGS: Mark as pre-release ONLY IF it's NOT a tag (meaning it's a branch push)
|
prerelease: false
|
||||||
prerelease: ${{ github.ref_type != 'tag' }}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# BACKUP
|
||||||
|
# build-linux:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v4
|
||||||
|
# # Not needed anymore due to the removal of Pacman builds
|
||||||
|
# # - name: Install build dependencies
|
||||||
|
# # run: |
|
||||||
|
# # sudo apt-get update
|
||||||
|
# # sudo apt-get install -y libarchive-tools
|
||||||
|
|
||||||
|
# - uses: actions/setup-node@v4
|
||||||
|
# with:
|
||||||
|
# node-version: '22'
|
||||||
|
# cache: 'npm'
|
||||||
|
# - run: npm ci
|
||||||
|
|
||||||
|
# - name: Build Linux Packages
|
||||||
|
# run: |
|
||||||
|
# npx electron-builder --linux --x64 --arm64 --publish never
|
||||||
|
# - uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: linux-builds
|
||||||
|
# path: |
|
||||||
|
# dist/*.AppImage
|
||||||
|
# dist/*.AppImage.blockmap
|
||||||
|
# dist/*.deb
|
||||||
|
# dist/*.rpm
|
||||||
|
# dist/*.pkg.tar.zst
|
||||||
|
# dist/latest-linux.yml
|
||||||
|
|
||||||
|
# build-windows:
|
||||||
|
# runs-on: windows-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v4
|
||||||
|
# - uses: actions/setup-node@v4
|
||||||
|
# with:
|
||||||
|
# node-version: '22'
|
||||||
|
# cache: 'npm'
|
||||||
|
# - run: npm ci
|
||||||
|
|
||||||
|
# - name: Build Windows Packages
|
||||||
|
# run: npx electron-builder --win --publish never
|
||||||
|
# - uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: windows-builds
|
||||||
|
# path: |
|
||||||
|
# dist/*.exe
|
||||||
|
# dist/*.exe.blockmap
|
||||||
|
# dist/latest.yml
|
||||||
|
|
||||||
|
# build-macos:
|
||||||
|
# runs-on: macos-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v4
|
||||||
|
# - uses: actions/setup-node@v4
|
||||||
|
# with:
|
||||||
|
# node-version: '22'
|
||||||
|
# cache: 'npm'
|
||||||
|
# - run: npm ci
|
||||||
|
|
||||||
|
# - name: Build macOS Packages
|
||||||
|
# run: npx electron-builder --mac --publish never
|
||||||
|
# - uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: macos-builds
|
||||||
|
# path: |
|
||||||
|
# dist/*.dmg
|
||||||
|
# dist/*.zip
|
||||||
|
# dist/latest-mac.yml
|
||||||
|
|
||||||
|
# release:
|
||||||
|
# needs: [build-linux, build-windows, build-macos]
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# if: |
|
||||||
|
# startsWith(github.ref, 'refs/tags/v') ||
|
||||||
|
# github.ref == 'refs/heads/release' ||
|
||||||
|
# github.event_name == 'workflow_dispatch'
|
||||||
|
|
||||||
|
# permissions:
|
||||||
|
# contents: write
|
||||||
|
|
||||||
|
# steps:
|
||||||
|
# # FIX: './package.json' Module Not Found in `Get version` step
|
||||||
|
# - name: Checkout code
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# - name: Download all artifacts
|
||||||
|
# uses: actions/download-artifact@v4
|
||||||
|
# with:
|
||||||
|
# path: artifacts
|
||||||
|
|
||||||
|
# - name: Display structure of downloaded files
|
||||||
|
# run: ls -R artifacts
|
||||||
|
|
||||||
|
# - name: Get version from package.json
|
||||||
|
# id: pkg_version
|
||||||
|
# run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# - name: Create Release
|
||||||
|
# uses: softprops/action-gh-release@v2
|
||||||
|
# with:
|
||||||
|
# # If it's a tag, use the tag.
|
||||||
|
# tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}.r{1}', steps.pkg_version.outputs.VERSION, github.run_number) }}
|
||||||
|
# # If it's the 'release' branch, use 'v2.0.2-beta.r42'
|
||||||
|
# name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}-beta.r{1}', steps.pkg_version.outputs.VERSION, github.run_number) }}
|
||||||
|
# files: |
|
||||||
|
# artifacts/linux-builds/**/*
|
||||||
|
# artifacts/windows-builds/**/*
|
||||||
|
# artifacts/macos-builds/**/*
|
||||||
|
# generate_release_notes: true
|
||||||
|
# draft: true
|
||||||
|
# # DYNAMIC FLAGS: Mark as pre-release ONLY IF it's NOT a tag (meaning it's a branch push)
|
||||||
|
# prerelease: ${{ github.ref_type != 'tag' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user