zip "$RELEASE_LinuxAMD64".zip "$RELEASE_LinuxAMD64"
zip "$RELEASE_LinuxARM64".zip "$RELEASE_Linux386"
zip "$RELEASE_LinuxARM".zip "$RELEASE_LinuxARM"
zip "$RELEASE_OSX".zip "$RELEASE_OSX"
- name:Create Release
id:create_release
uses:monkeyWie/create-release@master
env:
env:
GOOS:${{ matrix.goos }}
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
GOARCH:${{ matrix.arch }}
CGO_ENABLED:1
- uses:svenstaro/upx-action@v2
with:
with:
args:${{ matrix.args }}
tag_name:${{ github.ref }}
file:${{ matrix.bin }}
release_name:Release ${{ github.ref }}
- name:Upload to artifacts
draft:false
uses:actions/upload-artifact@v2
prerelease:true
- name:Upload Release - Windows 64bit
uses:actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
with:
with:
name:${{ env.RELEASE }}
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
path:${{ matrix.bin }}
asset_path:./${{ env.RELEASE_WIN64 }}.zip
package:
asset_name:${{ env.RELEASE_WIN64 }}.zip
name:Package Assets
asset_content_type:application/zip
runs-on:ubuntu-latest
needs:build
- name:Upload Release - Windows 32bit
steps:
uses:actions/upload-release-asset@v1.0.1
- uses:actions/checkout@v2
env:
- uses:actions/download-artifact@v2
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
with:
with:
path:bin
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- name:Package Releases
asset_path:./${{ env.RELEASE_WIN32 }}.zip
run:|
asset_name:${{ env.RELEASE_WIN32 }}.zip
mkdir releases;
asset_content_type:application/zip
for RELEASE_DIR in bin/*
do
- name:Upload Release - Linux amd64
echo "Creating release $RELEASE_DIR"
uses:actions/upload-release-asset@v1.0.1
for BINARY in $RELEASE_DIR/*
env:
do
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
chmod 777 $BINARY;
cp $BINARY .;
zip -r releases/$(basename $RELEASE_DIR).zip \
$(basename ${BINARY}) \
README.md \
README_ZH.md;
rm $BINARY;
done
done
- name:Upload to artifacts
uses:actions/upload-artifact@v2
with:
with:
name:releases
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
path:releases/*.zip
asset_path:./${{ env.RELEASE_LinuxAMD64 }}.zip
asset_name:${{ env.RELEASE_LinuxAMD64 }}.zip
asset_content_type:application/zip
upload:
- name:Upload Release - Linux 386
name:Upload to the Release
uses:actions/upload-release-asset@v1.0.1
runs-on:ubuntu-latest
env:
needs:package
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
steps:
- uses:actions/download-artifact@v2
with:
with:
name:releases
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
run:|
asset_path:./${{ env.RELEASE_LinuxARM }}.zip
HASH_TABLE="| SHA256 Hash | Filename |"
asset_name:${{ env.RELEASE_LinuxARM }}.zip
HASH_TABLE="${HASH_TABLE}\n|-----|-----|\n"
asset_content_type:application/zip
for FILE in releases/*
do
- name:Upload Release - Darwin amd64
FILENAME=$(basename ${FILE})
uses:actions/upload-release-asset@v1.0.1
HASH=$(sha256sum ${FILE} | cut -d ' ' -f 1)
env:
HASH_TABLE="${HASH_TABLE}|${HASH}|${FILENAME}|\n"
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
done
with:
echo "${HASH_TABLE}"
upload_url:${{ steps.create_release.outputs.upload_url }}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps