Skip to content

Commit

Permalink
Add release step to CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Nov 24, 2023
1 parent 6645395 commit 83ad78f
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- "master"
tags:
- "*"
paths-ignore:
- "**.md"
pull_request:
Expand Down Expand Up @@ -33,20 +35,29 @@ jobs:
os: macos-latest
compiler: clang
shell: bash
artifacts: true
pkg-path: pkg/osx/*.dmg
pkg-dir: pkg/osx

- name: MSYS2 UCRT64
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: ucrt64
msys-env: mingw-w64-ucrt-x86_64
artifacts: true
pkg-path: pkg/win32/*.zip
pkg-dir: pkg/win32

- name: MSYS2 MINGW32
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: mingw32
msys-env: mingw-w64-i686
artifacts: true
pkg-path: pkg/win32/*.zip
pkg-dir: pkg/win32

steps:
- name: Install pandoc
Expand Down Expand Up @@ -115,28 +126,30 @@ jobs:
PREFIX=`sed -n '/PROGRAM_PREFIX/p' ${PWD}/config.h | cut -d '"' -f 2`
make -j4 -C quickcheck check SOURCE_PORT=$PWD/src/${PREFIX}doom
- name: Package (macOS)
if: runner.os == 'macOS'
run: |
cd pkg/osx
make
- name: Package (MSYS2)
if: runner.os == 'Windows'
- name: Package
if: ${{ matrix.config.artifacts }}
run: |
cd pkg/win32
cd ${{ matrix.config.pkg-dir }}
make
- name: Upload artifacts (macOS)
if: runner.os == 'macOS'
- name: Upload artifacts
if: ${{ matrix.config.artifacts }}
uses: actions/upload-artifact@v3
with:
name: macOS
path: pkg/osx/*.dmg
name: ${{ matrix.config.name }}
path: ${{ matrix.config.pkg-path }}

- name: Upload artifacts (MSYS2)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
- name: Extract Package String
if: ${{ contains(github.ref, 'tags') }}
run: |
PACKAGE_STRING=`sed -n '/PACKAGE_STRING/p' ${PWD}/config.h | cut -d '"' -f 2`
echo "PACKAGE_STRING=${PACKAGE_STRING}" >> $GITHUB_ENV
- name: Release
if: ${{ contains(github.ref, 'tags') && matrix.config.artifacts }}
uses: ncipollo/release-action@v1
with:
name: Win-${{ matrix.config.msystem }}
path: pkg/win32/*.zip
name: ${{ env.PACKAGE_STRING }}
bodyFile: CHANGELOG.md
allowUpdates: true
artifacts: ${{ matrix.config.pkg-path }}

0 comments on commit 83ad78f

Please sign in to comment.