diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a58fd5e..016e238 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,14 +25,21 @@ jobs: run: crystal tool format --check - name: Run tests run: crystal spec + - name: package information + id: pkg_information + run: | + echo "DPKG_NAME=$(sed -n 's/^name: \(.*\)/\1/p' shard.yml |head -n1)" >> $GITHUB_ENV + echo "DPKG_ARCH=amd64" >> $GITHUB_ENV + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo ::set-output name=ASSERT_NAME::ASSERT_NAME=${DPKG_NAME}-${RELEASE_VERSION}-${KPKG_ARCH}-unknown-linux-musl.tar.gz - name: release binary run: | shards build --production --release --static --no-debug --link-flags="-s -Wl,-z,relro,-z,now" - strip ./bin/crystal_hello_world - tar zcf crystal_hello_world.tar.gz bin/crystal_hello_world LICENSE + strip ./bin/${DPKG_NAME} + tar zcf ${{ steps.pkg_information.outputs.ASSERT_NAME }} bin/${DPKG_NAME} LICENSE - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | - crystal_hello_world.tar.gz + ${{ steps.pkg_information.outputs.ASSERT_NAME }}