Skip to content

Commit

Permalink
ci: fix create gh release
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Sep 12, 2023
1 parent eacb2fd commit 8131ea3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/actions/make-archive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Make Archive
description: Archive files to zip
inputs:
files:
description: files to archive
required: true
out:
description: Output path
required: true
runs:
using: composite
steps:
- name: Archive (UNIX)
if: runner.os != 'Windows'
shell: bash
run: |
zip ${{ inputs.out }} ${{ inputs.files }} -j
- name: Archive (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive ${{ inputs.files }} ${{ inputs.out }}
2 changes: 1 addition & 1 deletion .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Generate artifacts name
id: gen-name
shell: bash
run: echo 'NAME=dev-${{ matrix.targets.alias }}' >> $GITHUB_OUTPUT
run: echo 'NAME=cnb-dev-${{ matrix.targets.alias }}' >> $GITHUB_OUTPUT

- name: Generate binary extension
id: gen-ext
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Generate artifacts name
id: gen-name
shell: bash
run: echo 'NAME=release-${{ matrix.targets.alias }}' >> $GITHUB_OUTPUT
run: echo 'NAME=cnb-${{ steps.gen-version.outputs.VERSION }}-${{ matrix.targets.alias }}' >> $GITHUB_OUTPUT

- name: Generate binary extension
id: gen-ext
Expand All @@ -79,8 +79,14 @@ jobs:
path: ./target/${{ matrix.targets.target }}/release/cnb${{ steps.gen-ext.outputs.EXT }}
if-no-files-found: error

- name: Create github release
uses: softprops/action-gh-release@v1
- name: Archive binary
uses: ./.github/actions/make-archive
with:
files: ./target/${{ matrix.targets.target }}/release/cnb${{ steps.gen-ext.outputs.EXT }}
out: ${{ steps.gen-name.outputs.NAME }}.zip

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.gen-name.outputs.NAME }}.zip

0 comments on commit 8131ea3

Please sign in to comment.