Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
Optiroc committed Mar 9, 2024
1 parent 30857be commit 9f1b7ff
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 19 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Main merge and pre-merge

on:
pull_request:
push:
branches: main

jobs:
build_ubuntu:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: make
build_macos:
name: macOS
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: make
build_windows:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: mkdir .build && cd .build && cmake .. && cmake --build . --config Release
48 changes: 32 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
name: Build check
name: Release

on:
pull_request:
push:
branches: main
tags:
- "v*.*.*"

jobs:
build_ubuntu:
name: Linux
runs-on: ubuntu-latest
release_macos_arm64:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
run: |
make
build_macos:
name: macOS
make TARGET="-target arm64-apple-macos11"
zip -j superfamiconv_macos_arm64_${{ github.ref_name }}.zip bin/superfamiconv README.md LICENSE
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: superfamiconv_macos_arm64_${{ github.ref_name }}.zip
release_macos_x86_64:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
run: |
make
build_windows:
name: Windows
make TARGET="-target x86_64-apple-macos11"
zip -j superfamiconv_macos_x86-64_${{ github.ref_name }}.zip bin/superfamiconv README.md LICENSE
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: superfamiconv_macos_x86-64_${{ github.ref_name }}.zip
release_win64:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
run: |
mkdir .build && cd .build && cmake .. && cmake --build . --config Release
mkdir build && cd build && cmake .. && cmake --build . --config Release && cd ..
move build\Release\superfamiconv.exe superfamiconv.exe
Compress-Archive -LiteralPath superfamiconv.exe, README.md, LICENSE -DestinationPath superfamiconv_win64_${{ github.ref_name }}.zip
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: superfamiconv_win64_${{ github.ref_name }}.zip
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CXX := g++
FLAGS := -Wall -Wextra -I$(INC_DIR)
CXX_FLAGS := -std=c++20
LD_FLAGS :=
TARGET :=

ifeq ($(DEBUG), 1)
CXX_FLAGS += -O0 -g
Expand All @@ -25,11 +26,11 @@ HEADERS += $(INC_DIR)/Options.h $(INC_DIR)/nlohmann/json.hpp $(wildcard $(IN
superfamiconv: $(BIN_DIR)/superfamiconv

$(BIN_DIR)/superfamiconv : $(OBJ_DIR)/superfamiconv.o $(OBJ_DIR)/sfc_palette.o $(OBJ_DIR)/sfc_tiles.o $(OBJ_DIR)/sfc_map.o $(COMMON_OBJ) $(LIBRARY_OBJ) | $(BIN_DIR)
$(CXX) $(LD_FLAGS) $^ -o $@
$(CXX) $(LD_FLAGS) $(TARGET) $^ -o $@

$(OBJ_DIR)/%.o : ./**/%.cpp $(HEADERS)
@mkdir -pv $(dir $@)
$(CXX) $(CXX_FLAGS) $(FLAGS) -c $< -o $@
$(CXX) $(CXX_FLAGS) $(FLAGS) $(TARGET) -c $< -o $@

$(BIN_DIR):
@mkdir -pv $@
Expand Down
2 changes: 1 addition & 1 deletion src/About.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace sfc::about {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-const-variable"

constexpr const char* VERSION = "0.9.2";
constexpr const char* VERSION = "0.10.0";

constexpr const char* COPYRIGHT = "Copyright (c) 2017-2024 David Lindecrantz";

Expand Down

0 comments on commit 9f1b7ff

Please sign in to comment.