Skip to content

Commit

Permalink
Merge pull request #113 from stephengtuggy/gh-actions-update_2024-05
Browse files Browse the repository at this point in the history
Update the set of OSes and distributions that we run GitHub Actions CI on; request regular Dependabot runs for the repo
  • Loading branch information
stephengtuggy authored May 5, 2024
2 parents 271e91b + 4e0977e commit 06cd14b
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 57 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
allow:
# Allow both direct and indirect updates for all packages
- dependency-type: "all"
16 changes: 13 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2

- name: Download benchmark bundle
env:
GH_TOKEN: ${{ github.token }}
# download the latest version
run: |
gh release download -R github/codeql-action --pattern 'codeql-bundle.tar.gz'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@4b6aa0b07da05d6e43d0e5f9c8596a6532ce1c85 #v2.15.3
with:
languages: ${{ matrix.language }}
tools: codeql-bundle.tar.gz
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand All @@ -43,4 +51,6 @@ jobs:
run: script/cibuild

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@4b6aa0b07da05d6e43d0e5f9c8596a6532ce1c85 #v2.15.3
with:
tools: codeql-bundle.tar.gz
5 changes: 2 additions & 3 deletions .github/workflows/fortify-on-demand-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3

- name: Fortify on Demand Scan
# You may pin to the exact commit or the version.
# uses: fortify/gha-setup-fod-uploader@636f3c3a14aec1747eec5242a02c6349e4f3cce6
uses: fortify/[email protected]
uses: fortify/gha-setup-fod-uploader@16e5036c084b26cee63cb0c38cfc2101cc9fd13d #v1.1.3
with:
# FoDUploader version to use
version: latest
32 changes: 21 additions & 11 deletions .github/workflows/gh-actions-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,44 @@ jobs:
name: Build
runs-on: ubuntu-latest

defaults:
run:
shell: bash

strategy:
fail-fast: true
matrix:
include:
# only do one Deb file because they're so large
- FROM: 'debian:buster'
- FROM: 'debian:bullseye'
- FROM: 'opensuse/leap:15.5'
- FROM: 'opensuse/leap:15.4'
- FROM: 'opensuse/leap:15.3'
- FROM: 'opensuse/leap:15.2'
- FROM: 'fedora:37'
- FROM: 'fedora:36'
- FROM: 'fedora:35'
- FROM: 'rockylinux:9.0'
- FROM: 'rockylinux:8.6'
- FROM: 'rockylinux:8.5'
- FROM: 'fedora:40'
- FROM: 'fedora:39'
- FROM: 'fedora:38'
- FROM: 'rockylinux:9.3'
- FROM: 'manjarolinux/base'

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2
submodules: false

# Ensure PRs are built against the PR Head
# As opposed to the merge commit
- name: Move to PR HEAD
run: git checkout HEAD^2
run: git checkout ${{ github.event.pull_request.head.sha }}

- name: Extract short SHA
shell: bash
run: |
echo "SHORT_SHA=`git rev-parse --short ${{ github.event.pull_request.head.sha }}`" >> $GITHUB_ENV
- name: Test short SHA
run: |
echo "${SHORT_SHA}"
- name: Run CI
env:
FROM: ${{ matrix.FROM }}
Expand Down
38 changes: 21 additions & 17 deletions .github/workflows/gh-actions-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
continue-on-error: true

defaults:
run:
shell: bash

strategy:
fail-fast: false
Expand All @@ -19,41 +24,38 @@ jobs:
- FROM: 'ubuntu:focal'
ARTIFACT_EXT: 'tar.[xb]z*'
# only build one Deb File b/c they're so large
- FROM: 'debian:buster'
- FROM: 'debian:bullseye'
ARTIFACT_EXT: 'deb'
- FROM: 'opensuse/leap:15.4'
ARTIFACT_EXT: 'rpm'
- FROM: 'opensuse/leap:15.3'
ARTIFACT_EXT: 'rpm'
- FROM: 'opensuse/leap:15.2'
- FROM: 'opensuse/leap:15.5'
ARTIFACT_EXT: 'rpm'
- FROM: 'fedora:37'
ARTIFACT_EXT: 'rpm'
- FROM: 'fedora:36'
- FROM: 'opensuse/leap:15.4'
ARTIFACT_EXT: 'rpm'
- FROM: 'fedora:35'
- FROM: 'fedora:40'
ARTIFACT_EXT: 'rpm'
- FROM: 'rockylinux:9.0'
- FROM: 'fedora:39'
ARTIFACT_EXT: 'rpm'
- FROM: 'rockylinux:8.6'
- FROM: 'fedora:38'
ARTIFACT_EXT: 'rpm'
- FROM: 'rockylinux:8.5'
- FROM: 'rockylinux:9.3'
ARTIFACT_EXT: 'rpm'

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f #v4.1.3
with:
fetch-depth: 2
submodules: false

- name: Extract tag name etc
- name: Extract tag name and short SHA
shell: bash
run: |
echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/} | sed 's/\//_/g')" >> $GITHUB_ENV
- name: Test tag name etc
echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV
- name: Test tag name and short SHA
run: |
echo "${TAG_NAME}"
echo "${SHORT_SHA}"
- name: Run CI
env:
FROM: ${{ matrix.FROM }}
Expand All @@ -62,8 +64,10 @@ jobs:
MY_OS_NAME: linux
IS_RELEASE: 1
run: script/cibuild $FLAGS

- name: Upload the artifacts
uses: skx/github-action-publish-binaries@master
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
#uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_EXT: ${{ matrix.ARTIFACT_EXT }}
Expand Down
67 changes: 44 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,55 @@
# along with vsUTCS. If not, see <https://www.gnu.org/licenses/>.


CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16 FATAL_ERROR)

SET(vsUTCS_VERSION_MAJOR "0")
SET(vsUTCS_VERSION_MINOR "9")
SET(vsUTCS_VERSION_MINOR "10")
SET(vsUTCS_VERSION_PATCH "0")

# Auto-populate with the git hash of the build
IF (DEFINED ENV{GITHUB_SHA} AND NOT "$ENV{GITHUB_SHA}" STREQUAL "")
SET (vsUTCS_VERSION_TWEAK "$ENV{GITHUB_SHA}")
IF (DEFINED ENV{SHORT_SHA} AND NOT "$ENV{SHORT_SHA}" STREQUAL "")
SET (vsUTCS_VERSION_TWEAK "$ENV{SHORT_SHA}")
ELSE ()
SET (GIT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
MESSAGE(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}")
MESSAGE(STATUS "GIT_ROOT_DIR = ${GIT_ROOT_DIR}")
EXECUTE_PROCESS(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${GIT_ROOT_DIR}
OUTPUT_VARIABLE vsUTCS_VERSION_TWEAK
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ENDIF ()

SET(vsUTCS_VERSION_LONG_STR "${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}-${vsUTCS_VERSION_TWEAK}")
SET(vsUTCS_VERSION_SHORT_STR "${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}")
SET(vsUTCS_PKG_VERSION_STR "${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}")

IF (DEFINED ENV{TAG_NAME} AND NOT "$ENV{TAG_NAME}" STREQUAL "")
STRING(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" TAG_VERSION_MAJOR "$ENV{TAG_NAME}")
STRING(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" TAG_VERSION_MINOR "$ENV{TAG_NAME}")
STRING(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" TAG_VERSION_PATCH "$ENV{TAG_NAME}")
STRING(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" TAG_VERSION_TWEAK "$ENV{TAG_NAME}")

SET(TAG_VERSION_SHORT_STR "${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH}")

IF (NOT "${vsUTCS_VERSION_SHORT_STR}" VERSION_EQUAL "${TAG_VERSION_SHORT_STR}")
MESSAGE(FATAL_ERROR "Project version spelled out in CMake file does not match project version from TAG_NAME environment variable")
ENDIF ()
IF (NOT "${TAG_VERSION_TWEAK}" STREQUAL "")
SET(vsUTCS_VERSION_LONG_STR "${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}${TAG_VERSION_TWEAK}-${vsUTCS_VERSION_TWEAK}")
SET(vsUTCS_PKG_VERSION_STR "${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}${TAG_VERSION_TWEAK}")
ENDIF ()
ENDIF ()

PROJECT(vsUTCS
VERSION
"${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}" #.${vsUTCS_VERSION_TWEAK} # CMake only allows numeric version components, unfortunately.
)

MESSAGE("== Vega Strike: Upon the Coldest Sea Version: ${vsUTCS_VERSION_LONG_STR}")

# Let cmake find our in-tree modules
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${vsUTCS_SOURCE_DIR})

Expand Down Expand Up @@ -179,16 +206,11 @@ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vsUTCS-${CPACK_PACKAGE_VERSION_MAJOR}.${CPA
SET(CPACK_CONTACT "[email protected]")

# Source package filename
IF (DEFINED ENV{TAG_NAME})
SET(vsUTCS_PACKAGE_VERSION_STR "$ENV{TAG_NAME}")
ELSE (DEFINED ENV{TAG_NAME})
SET(vsUTCS_PACKAGE_VERSION_STR "${vsUTCS_VERSION_MAJOR}.${vsUTCS_VERSION_MINOR}.${vsUTCS_VERSION_PATCH}-0.${vsUTCS_VERSION_TWEAK}")
ENDIF (DEFINED ENV{TAG_NAME})
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${vsUTCS_PACKAGE_VERSION_STR}-Source")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${vsUTCS_PKG_VERSION_STR}-Source")
SET(CPACK_SOURCE_GENERATOR "TXZ")

IF (WIN32 AND NOT UNIX)
MESSAGE("-- Configuring Packaging for Windows")
MESSAGE(STATUS "Configuring Packaging for Windows (not fully implemented)")
# NSIS - See https://cmake.org/cmake/help/v3.3/module/CPackNSIS.html
# NSI bug requires at least 1 set of 4 forwards slashes??
SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\favicon.ico")
Expand All @@ -201,29 +223,28 @@ IF (WIN32 AND NOT UNIX)
# NSIS, Wix, and compressed archives (7z, Zip)
SET(CPACK_GENERATOR "NSIS" "NSIS64" "WIX" "7Z" "ZIP")
# SET(CPACK_PACKAGE_EXECUTABLES "vegastrike.exe" "mesh_tool.exe" "vegasettings.exe")
ELSEIF (XCODE)
MESSAGE("-- Configuring Packaging for Mac OS X")
# Mac OS X
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Darwin)
MESSAGE(STATUS "Configuring Packaging for macOS (not fully implemented)")
# There's a few options for MacOSX; not sure what we want to use
# DragNDrop -> DMG
# See https://cmake.org/cmake/help/v3.3/module/CPackDMG.html
# Bundle -> Compressed Disk Image
# PackageMaker - see https://cmake.org/cmake/help/v3.3/module/CPackPackageMaker.html
SET(CPACK_GENERATOR "DragNDrop" "BUNDLE" "TXZ")
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux)
MESSAGE("-- Configuring Packaging for Linux")
MESSAGE(STATUS "Configuring Packaging for Linux")
SET(CPACK_GENERATOR "TXZ")

# "DEB"
IF (VS_CAN_BUILD_DEB)
MESSAGE("-- Configuring Debian Packaging")
MESSAGE(STATUS "Configuring Debian Packaging")
# See https://cmake.org/cmake/help/v3.3/module/CPackDeb.html
SET(CPACK_DEBIAN_PACKAGE_NAME "vsUTCS")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]")
SET(CPACK_DEBIAN_COMPRESSION_TYPE "bzip2")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "vega-strike")

SET(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}_${vsUTCS_PACKAGE_VERSION_STR}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}_${vsUTCS_PKG_VERSION_STR}")

SET(CPACK_DEBIAN_PACKAGE_SECTION "Amusements/Games")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.vega-strike.org")
Expand All @@ -232,7 +253,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux)

# "RPM"
IF (VS_CAN_BUILD_RPM)
MESSAGE("-- Configuring RPM Packaging")
MESSAGE(STATUS "Configuring RPM Packaging")
# See https://cmake.org/cmake/help/v3.3/module/CPackRPM.html
SET(CPACK_RPM_PACKAGE_LICENSE "GPLv3") # See ../LICENSE
SET(CPACK_RPM_PACKAGE_URL "https://www.vega-strike.org")
Expand All @@ -246,13 +267,13 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux)
SET(vsUTCS_LINUX_VERSION_STR "${LINUX_VERSION_ID}")
ENDIF (LINUX_CODENAME)

SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}_${vsUTCS_PACKAGE_VERSION_STR}-${LINUX_ID}-${vsUTCS_LINUX_VERSION_STR}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}_${vsUTCS_PKG_VERSION_STR}-${LINUX_ID}-${vsUTCS_LINUX_VERSION_STR}")
SET(CPACK_GENERATOR "RPM")
ENDIF ()
ELSE (WIN32 AND NOT UNIX)
MESSAGE("-- Configuring Packaging for Unknown Platforms - \"${CMAKE_SYSTEM_NAME}\"")
ELSE ()
MESSAGE(STATUS "Configuring Packaging for Unknown Platform - \"${CMAKE_SYSTEM_NAME}\"")
# Unknown Platform --> Just do compressed tarball
SET(CPACK_GENERATOR "TXZ")
ENDIF (WIN32 AND NOT UNIX)
ENDIF ()

INCLUDE(CPack)

0 comments on commit 06cd14b

Please sign in to comment.