fix: workflow cleanup #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test & Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test-unix: | |
name: Test Unix | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Test sh | |
run: ./install.sh | |
- name: Validate sh output | |
run: | | |
if [ ! -f ftb-server-installer ]; then | |
echo "ftb-server-installer not found. Please run install.sh first." | |
exit 1 | |
fi | |
echo "ftb-server-installer exists." | |
- name: Clean up | |
run: rm -f ftb-server-installer | |
test-windows: | |
name: Test Windows | |
runs-on: windows-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Test Batch | |
shell: cmd | |
run: .\install.bat | |
- name: Validate Batch output | |
shell: cmd | |
run: | | |
if NOT exist ftb-server-installer.exe ( | |
echo "ftb-server-installer not found. Please run install.bat first." | |
exit 1 | |
) | |
echo "ftb-server-installer exists." | |
- name: Clean up | |
run: del /F .\ftb-server-installer.exe | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
- test-unix | |
- test-windows | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Create versio | |
run: echo "BINARY_VERSION=1.0.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | |
- name: Release to github | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "v$BINARY_VERSION" \ | |
-t "v$BINARY_VERSION" \ | |
--notes "Auto generated release for v$BINARY_VERSION" \ | |
--generate-notes \ | |
./install.sh \ | |
./install.ps1 |