Skip to content

Commit

Permalink
feat: windowsでのzip圧縮対応
Browse files Browse the repository at this point in the history
  • Loading branch information
cffnpwr committed Jul 2, 2024
1 parent 0044f66 commit 046f662
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 39 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,23 @@ jobs:
job:
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
extension: ""
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
extension: ""
- runner: ubuntu-24.04
target: aarch64-unknown-linux-gnu
extension: ""
- runner: ubuntu-24.04
target: aarch64-unknown-linux-musl
extension: ""
- runner: windows-2022
target: x86_64-pc-windows-msvc
extension: ".exe"
- runner: windows-2022
target: x86_64-pc-windows-gnu
extension: ".exe"
- runner: windows-2022
target: aarch64-pc-windows-msvc
extension: ".exe"
- runner: macos-13
target: x86_64-apple-darwin
extension: ""
- runner: macos-14
target: aarch64-apple-darwin
extension: ""

runs-on: ${{ matrix.job.runner }}
steps:
- name: Checkout
Expand Down Expand Up @@ -135,16 +127,33 @@ jobs:

- name: tar archive
id: tar
if: ${{ !contains(matrix.job.target, 'windows') }}
run: |
FILENAME=snails-machine-${{ inputs.version || steps.date.outputs.date }}-${{ matrix.job.target }}.tar.gz
tar czf ${FILENAME} -C target/${{ matrix.job.target }}/release snails-machine${{ matrix.job.extension }}
tar czf ${FILENAME} -C target/${{ matrix.job.target }}/release snails-machine
echo "filename=${FILENAME}" >> $GITHUB_OUTPUT
- name: zip archive
id: zip
if: contains(matrix.job.target, 'windows')
run: |
$env:FILENAME=snails-machine-${{ inputs.version || steps.date.outputs.date }}-${{ matrix.job.target }}.zip
Compress-Archive -Path .\\target\\${{ matrix.job.target }}\\release\\snails-machine.exe -DestinationPath $env:FILENAME
echo "filename=${FILENAME}" >> $env:GITHUB_OUTPUT
- name: Save artifact
- name: Save tar artifact
if: ${{ !contains(matrix.job.target, 'windows') }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.version || steps.date.outputs.date }}-${{ matrix.job.target }}
path: ./${{ steps.tar.outputs.filename }}

- name: Save zip artifact
if: contains(matrix.job.target, 'windows')
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.version || steps.date.outputs.date }}-${{ matrix.job.target }}
path: ./${{ steps.zip.outputs.filename }}



32 changes: 4 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,17 @@ jobs:
run: |
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
build-linux:
needs:
- version
uses: ./.github/workflows/build-linux.yaml
with:
version: ${{ needs.version.outputs.version }}

build-windows-msvc:
needs:
- version
uses: ./.github/workflows/build-win-msvc.yaml
with:
version: ${{ needs.version.outputs.version }}

build-windows-gnu:
needs:
- version
uses: ./.github/workflows/build-win-gnu.yaml
with:
version: ${{ needs.version.outputs.version }}

build-macos:
needs:
build:
uses: ./.github/workflows/build.yaml
needs:
- version
uses: ./.github/workflows/build-macos.yaml
with:
version: ${{ needs.version.outputs.version }}

attach-artifacts:
needs:
- version
- build-linux
- build-windows-msvc
- build-windows-gnu
- build-macos
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down

0 comments on commit 046f662

Please sign in to comment.