Skip to content

Commit

Permalink
[CI/CD] Upload .tar.gz files for linux and macOS instead of a .tar in…
Browse files Browse the repository at this point in the history
…side of a .zip
  • Loading branch information
taysta committed Sep 15, 2024
1 parent 56014f0 commit bcdf101
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# Run on pushes to tags, the "master" branch, and PR's
push:
branches:
- master
- cicd-test-tar
paths-ignore:
- '**.md'
- '*.txt'
Expand Down Expand Up @@ -142,13 +142,13 @@ jobs:
chmod +x start_jaMME.sh
rm start_jaMME.command
rm start_jaMME.cmd
tar -cvf jamme-linux-${{ matrix.arch }}.tar ./*
tar -czvf jamme-linux-${{ matrix.arch }}.tar.gz ./*
- uses: actions/upload-artifact@v4
if: matrix.cc == 'gcc' && matrix.config == 'Release'
with:
name: jamme-linux-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/jamme-linux-${{ matrix.arch }}.tar
path: ${{runner.workspace}}/jaMME/build/jamme-linux-${{ matrix.arch }}.tar.gz
if-no-files-found: error

macos:
Expand Down Expand Up @@ -203,13 +203,13 @@ jobs:
chmod +x start_jaMME.command
rm start_jaMME.cmd
rm start_jaMME.sh
tar -cvf jamme-macos-${{ matrix.arch }}.tar ./*
tar -czvf jamme-macos-${{ matrix.arch }}.tar.gz ./*
- uses: actions/upload-artifact@v4
if: matrix.cc == 'clang' && matrix.config == 'Release'
with:
name: jamme-macos-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar.gz
if-no-files-found: error

macos-arm64:
Expand Down Expand Up @@ -264,17 +264,17 @@ jobs:
chmod +x start_jaMME.command
rm start_jaMME.cmd
rm start_jaMME.sh
tar -cvf jamme-macos-${{ matrix.arch }}.tar ./*
tar -czvf jamme-macos-${{ matrix.arch }}.tar.gz ./*
- uses: actions/upload-artifact@v4
if: matrix.cc == 'clang' && matrix.config == 'Release'
with:
name: jamme-macos-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar.gz
if-no-files-found: error

create-release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
if: github.ref == 'refs/heads/cicd-test-tar' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [windows, ubuntu, macos, macos-arm64]
runs-on: ubuntu-latest
steps:
Expand All @@ -291,10 +291,10 @@ jobs:
- name: Create binary archives
run: |
7z a -r jamme-linux-x86.zip ./jamme-linux-x86/*
7z a -r jamme-linux-x86_64.zip ./jamme-linux-x86_64/*
7z a -r jamme-windows-x86.zip ./jamme-windows-x86/*
7z a -r jamme-macos-x86_64.zip ./jamme-macos-x86_64/*
7z a -r jamme-macos-arm64.zip ./jamme-macos-arm64/*
mv ./jamme-linux-x86/* ./jamme-linux-x86.tar.gz
mv ./jamme-linux-x86_64/* ./jamme-linux-x86_64.tar.gz
mv ./jamme-macos-x86_64/* ./jamme-macos-x86_64.tar.gz
mv ./jamme-macos-arm64/* ./jamme-macos-arm64.tar.gz
- name: Create latest build
uses: crowbarmaster/GH-Automatic-Releases@latest
Expand All @@ -305,3 +305,4 @@ jobs:
title: Latest Build
files: |
*.zip
*.tar.gz

0 comments on commit bcdf101

Please sign in to comment.