Skip to content

Commit

Permalink
build: use BINARY_NAME (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi authored Aug 25, 2024
1 parent b66289a commit 27601c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,28 @@ jobs:
with:
tool: cross
- run: mkdir dist
- run: ${{ (!matrix.os && matrix.use-cross) && 'cross' || 'cargo' }} rustc --locked ${{ github.ref_name == github.event.repository.default_branch && '--release' || '' }} --no-default-features --target=${{ matrix.target }} -- --emit=link=dist/binary
- run: ${{ (!matrix.os && matrix.use-cross) && 'cross' || 'cargo' }} rustc --locked ${{ github.ref_name == github.event.repository.default_branch && '--release' || '' }} --no-default-features --target=${{ matrix.target }} -- --emit=link=dist/${{ needs.env.outputs.BINARY_NAME }}
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: ${{ matrix.target }}
path: |
dist/binary
dist/binary.exe
dist/${{ needs.env.outputs.BINARY_NAME }}
dist/${{ needs.env.outputs.BINARY_NAME }}.exe
- name: Upload to release
if: ${{ inputs.tag-name }}
working-directory: dist/
run: |
if [ -e binary.exe ]; then
if [ -e ${{ needs.env.outputs.BINARY_NAME }}.exe ]; then
filename="${{ needs.env.outputs.BINARY_NAME }}-${{ inputs.tag-name }}-${{ matrix.target }}.exe"
mv binary.exe "$filename"
mv ${{ needs.env.outputs.BINARY_NAME }}.exe "$filename"
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.target }} --clobber
else
filename="${{ needs.env.outputs.BINARY_NAME }}-${{ inputs.tag-name }}-${{ matrix.target }}"
mv binary "$filename"
mv ${{ needs.env.outputs.BINARY_NAME }} "$filename"
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.target }} --clobber
fi
image:
needs: build
needs: [env, build]
if: ${{ github.event_name != 'pull_request' }}
permissions:
packages: write
Expand Down Expand Up @@ -137,8 +137,8 @@ jobs:
run: |
build() {
newcontainer=$(buildah from --platform="$1" scratch)
buildah copy --chmod=0755 $newcontainer ./artifact/"$2"/binary /binary
buildah config --entrypoint='["./binary"]' $newcontainer
buildah copy --chmod=0755 $newcontainer ./artifact/"$2"/${{ needs.env.outputs.BINARY_NAME }} /${{ needs.env.outputs.BINARY_NAME }}
buildah config --entrypoint='["./${{ needs.env.outputs.BINARY_NAME }}"]' $newcontainer
buildah config --author="Mogyuchi" $(awk '{print "--label=" $0}' <<< "${{ steps.meta.outputs.labels }}") $newcontainer
buildah inspect $newcontainer
Expand Down

0 comments on commit 27601c0

Please sign in to comment.