Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan authored Jun 19, 2024
1 parent b43ffae commit 3f6f6fe
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 122 deletions.
64 changes: 11 additions & 53 deletions .github/workflows/build-linux-ci.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,16 @@
name: Build Linux
name: Build - Linux

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
repository_dispatch:
types: [init]

concurrency:
group: environment-lin-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build - ${{ matrix.config.os }}
call-workflow:
uses: Silverlan/pragma/.github/workflows/build-module.yml@main
if: github.repository != 'Silverlan/pr_module_template'
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-22.04
name: "Ubuntu GCC-11"
artifact: "ubuntu_gcc.7z"
build_type: "RelWithDebInfo"
cc: "clang-14"
cxx: "clang++-14"
archiver: "7z a"
generators: "Unix Makefiles"
build_dir: 'build'
steps:
- name: Get Module Info
id: module-info
uses: Silverlan/pr_module_template/github_actions/get_module_info@main

- name: Build Module
id: build-module
uses: Silverlan/pragma/github_actions/build_generic_module@main
with:
module: '${{ steps.module-info.outputs.module_name }}'

- name: Create Release Files
shell: bash
run: |
if [ "${{ steps.module-info.outputs.release_directory }}" != "DEFAULT" ]; then
mkdir -p "release/${{ steps.module-info.outputs.release_directory }}"
cp -a "${{ steps.build-module.outputs.install-dir }}/${{ steps.module-info.outputs.release_directory }}." "release/${{ steps.module-info.outputs.release_directory }}"
else
mkdir -p "release/${{ steps.module-info.outputs.install_directory }}"
cp "${{ steps.build-module.outputs.install-dir }}/${{ steps.module-info.outputs.install_directory }}lib${{ steps.module-info.outputs.module_name }}.so" "release/${{ steps.module-info.outputs.install_directory }}"
fi
- name: Release Binaries
uses: Silverlan/common_actions/release_nightly_binaries@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ github.ref_name }}
with:
repository: '${{ github.repository }}'
os: linux
secrets:
repository_token: ${{ secrets.REPO_ACCESS_TOKEN }}
permissions:
contents: write
65 changes: 11 additions & 54 deletions .github/workflows/build-windows-ci.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,16 @@
name: Build Windows
name: Build - Windows

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
repository_dispatch:
types: [init]

concurrency:
group: environment-win-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build - ${{ matrix.config.os }}
call-workflow:
uses: Silverlan/pragma/.github/workflows/build-module.yml@main
if: github.repository != 'Silverlan/pr_module_template'
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: windows-latest
name: "Windows x64 MSVC"
artifact: "Windows-MSVC.tar.xz"
build_type: "RelWithDebInfo"
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cc: "cl"
cxx: "cl"
archiver: "7z a"
generators: "Visual Studio 16 2022"
build_dir: 'build'
steps:
- name: Get Module Info
id: module-info
uses: Silverlan/pr_module_template/github_actions/get_module_info@main

- name: Build Module
id: build-module
uses: Silverlan/pragma/github_actions/build_generic_module@main
with:
module: '${{ steps.module-info.outputs.module_name }}'

- name: Create Release Files
shell: bash
run: |
if [ "${{ steps.module-info.outputs.release_directory }}" != "DEFAULT" ]; then
mkdir -p "release/${{ steps.module-info.outputs.release_directory }}"
cp -a "${{ steps.build-module.outputs.install-dir }}/${{ steps.module-info.outputs.release_directory }}." "release/${{ steps.module-info.outputs.release_directory }}"
else
mkdir -p "release/${{ steps.module-info.outputs.install_directory }}"
cp "${{ steps.build-module.outputs.install-dir }}/${{ steps.module-info.outputs.install_directory }}${{ steps.module-info.outputs.module_name }}.dll" "release/${{ steps.module-info.outputs.install_directory }}"
fi
- name: Release Binaries
uses: Silverlan/common_actions/release_nightly_binaries@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ github.ref_name }}
with:
repository: '${{ github.repository }}'
os: windows
secrets:
repository_token: ${{ secrets.REPO_ACCESS_TOKEN }}
permissions:
contents: write
23 changes: 8 additions & 15 deletions .github/workflows/create-release-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Create Stable Release

on:
workflow_dispatch:
inputs:
Expand All @@ -8,18 +9,10 @@ on:
type: string

jobs:
build:
name: Publish Release
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-24.04
name: "Ubuntu 24.04"
steps:
- name: Publish Release
uses: Silverlan/pr_module_template/github_actions/publish_release@main
with:
version: ${{ inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
call-workflow:
uses: Silverlan/pragma/.github/workflows/release-module.yml@main
if: github.repository != 'Silverlan/pr_module_template'
with:
version: '${{ inputs.version }}'
permissions:
contents: write

0 comments on commit 3f6f6fe

Please sign in to comment.