-
Notifications
You must be signed in to change notification settings - Fork 2
Add multi-platform release workflow #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add multi-platform release workflow #10
Conversation
Build for Linux, macOS, Windows (AMD64/ARM64) with testing and checksums.
blinxen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for this PR! Glad you like the tool!
I left a couple of remarks / thoughts on some of the changes.
| arch_name: amd64 | ||
| file_ext: tar.gz | ||
| # macOS ARM64 | ||
| - os: macos-14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any special reason this is macos-14 and not macos-latest?
| strategy: | ||
| matrix: | ||
| include: | ||
| # Linux AMD64 (musl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why Linux is built using musl?
| - name: Install Rust target and cross-compilation tools (Unix) | ||
| run: | | ||
| rustup target add ${{ matrix.rust_target }} | ||
| if [ "${{ matrix.rust_target }}" = "x86_64-unknown-linux-musl" ]; then | ||
| sudo apt-get update | ||
| sudo apt-get install -y musl-tools | ||
| elif [ "${{ matrix.rust_target }}" = "aarch64-unknown-linux-musl" ]; then | ||
| sudo apt-get update | ||
| sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu | ||
| mkdir -p .cargo | ||
| echo '[target.aarch64-unknown-linux-musl]' > .cargo/config.toml | ||
| echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml | ||
| fi | ||
| if: ${{ matrix.os != 'windows-latest' }} | ||
|
|
||
| - name: Install Rust target (Windows) | ||
| run: rustup target add ${{ matrix.rust_target }} | ||
| if: ${{ matrix.os == 'windows-latest' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two can be merged together
| elif [[ "${{ matrix.os }}" == macos-* ]]; then | ||
| cp target/${{ matrix.rust_target }}/release/${{ env.PROJECT_NAME }} ${BINARY_EXECUTABLE_NAME} | ||
| tar -czf ${ARCHIVE_NAME}.tar.gz ${BINARY_EXECUTABLE_NAME} CHANGELOG.md LICENSE | ||
| else # Linux | ||
| cp target/${{ matrix.rust_target }}/release/${{ env.PROJECT_NAME }} ${BINARY_EXECUTABLE_NAME} | ||
| tar -czf ${ARCHIVE_NAME}.tar.gz ${BINARY_EXECUTABLE_NAME} CHANGELOG.md LICENSE | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two look pretty much the same. You can probably merge them.
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}-${{ matrix.arch_name }} | ||
| path: ${{ env.ARCHIVE_NAME }}.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the .* do here? I prefer to not use wildcards whenever possible.
| name: ${{ env.PROJECT_NAME }}-darwin-universal | ||
| path: ${{ env.UNIVERSAL_ARCHIVE_NAME }}.tar.gz | ||
|
|
||
| test-binaries: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand this step. It does the same as the integration tests in tests/. IMHO, this can be replaced by running the integration tests in the different environments.
| tar -czf tomli.tar.gz tomli CHANGELOG.md LICENSE | ||
| echo "# SHA256 Checksums for ${{ env.PROJECT_NAME }} ${{ env.VERSION }}" > SHA256SUMS | ||
| echo "# Verify with: sha256sum -c SHA256SUMS" >> SHA256SUMS | ||
| echo "" >> SHA256SUMS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| echo "" >> SHA256SUMS | |
| echo >> SHA256SUMS |
|
Looking at the published archives, I would also prefer them following the convention |
This tool is awesome — thank you!
I’ve prepared a multi-platform release workflow with specific binary formats so that this tool can be registered in the aqua registry.
Here’s an example release published by this workflow:
https://github.com/vHideyukiHoukawa/tomli/releases/tag/v0.4.1-test-32