Skip to content

Commit

Permalink
Merge pull request #27 from 0xPolygonHermez/edu/add_new_binaries
Browse files Browse the repository at this point in the history
add new binaries
  • Loading branch information
eduadiez authored Jul 25, 2024
2 parents 2a71be9 + f38a2e7 commit 1fe8024
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"categories": [
{
"title": "## Features",
"labels": ["feature"]
},
{
"title": "## Fixes",
"labels": ["bug", "fix"]
}
],
"ignore_labels": ["L-ignore"],
"template": "${{CHANGELOG}}\n## Other\n\n${{UNCATEGORIZED}}",
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
"empty_template": "- No changes"
}
14 changes: 14 additions & 0 deletions .github/scripts/create-tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = async ({ github, context }, tagName) => {
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${tagName}`,
sha: context.sha,
force: true,
});
} catch (err) {
console.error(`Failed to create tag: ${tagName}`);
console.error(err);
}
};
15 changes: 15 additions & 0 deletions .github/scripts/move-tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = async ({ github, context }, tagName) => {
try {
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${tagName}`,
sha: context.sha,
force: true,
});
} catch (err) {
console.error(`Failed to move nightly tag.`);
console.error(`This should only happen the first time.`);
console.error(err);
}
};
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

env:
CARGO_TERM_COLOR: always
IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

permissions:
contents: write
Expand Down Expand Up @@ -169,9 +170,9 @@ jobs:
[[ "$target" == *windows* ]] && exe=".exe"
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release -p cargo-zisk --target "$target" "${flags[@]}"
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release -p cargo-zisk -p ziskemu -p riscv2zisk --target "$target" "${flags[@]}"
bins=(cargo-zisk)
bins=(cargo-zisk ziskemu)
for name in "${bins[@]}"; do
bin=./target/$target/release/$name$exe
file "$bin" || true
Expand All @@ -189,16 +190,16 @@ jobs:
shell: bash
run: |
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-zisk
tar -czvf "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-zisk ziskemu riscv2zisk
echo "file_name=cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-zisk
gtar -czvf "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release cargo-zisk ziskemu riscv2zisk
echo "file_name=cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
else
cd ./target/${TARGET}/release
7z a -tzip "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" cargo-zisk.exe
7z a -tzip "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" cargo-zisk.exe ziskemu.exe riscv2zisk.exe
mv "cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "file_name=cargo_zisk_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
fi
Expand All @@ -215,7 +216,6 @@ jobs:
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.cargo_zisk_man }}
# If this is a nightly release, it also updates the release
# tagged `nightly` for compatibility with `ziskup`
Expand All @@ -229,7 +229,6 @@ jobs:
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.cargo_zisk_man }}
cleanup:
name: Release cleanup
Expand Down

0 comments on commit 1fe8024

Please sign in to comment.