-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from lswith/build
Fix Releasing
- Loading branch information
Showing
4 changed files
with
178 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,85 @@ | ||
# name: release | ||
# on: | ||
# push: | ||
# tags: | ||
# - "v*" | ||
# jobs: | ||
# publish: | ||
# name: publish to crates.io | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# # - name: publish oci-tester to crates.io | ||
# # run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} | ||
on: | ||
release: | ||
types: [created] | ||
|
||
# on: | ||
# push | ||
# release: | ||
# types: [created] | ||
jobs: | ||
release: | ||
name: Release - ${{ matrix.platform.release_for }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- release_for: Linux-x86_64 | ||
os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
bin: oci-tester | ||
name: oci-tester-Linux-x86_64-musl.tar.gz | ||
|
||
# jobs: | ||
# release: | ||
# name: Release - ${{ matrix.platform.release_for }} | ||
# strategy: | ||
# matrix: | ||
# platform: | ||
# - release_for: Linux-x86_64 | ||
# os: ubuntu-latest | ||
# target: x86_64-unknown-linux-musl | ||
# bin: oci-tester | ||
# name: oci-tester-Linux-x86_64-musl.tar.gz | ||
# | ||
# - release_for: Linux-aarch64 | ||
# os: ubuntu-latest | ||
# target: aarch64-unknown-linux-musl | ||
# bin: oci-tester | ||
# name: oci-tester-Linux-aarch64-musl.tar.gz | ||
# | ||
# - release_for: Linux-arm | ||
# os: ubuntu-latest | ||
# target: arm-unknown-linux-musleabi | ||
# bin: oci-tester | ||
# name: oci-tester-Linux-arm-musl.tar.gz | ||
# | ||
# - release_for: Windows-i686 | ||
# os: windows-latest | ||
# target: i686-pc-windows-msvc | ||
# bin: oci-tester.exe | ||
# name: oci-tester-Windows-i686.zip | ||
# | ||
# - release_for: Windows-x86_64 | ||
# os: windows-latest | ||
# target: x86_64-pc-windows-msvc | ||
# bin: oci-tester.exe | ||
# name: oci-tester-Windows-x86_64.zip | ||
# | ||
# - release_for: macOS-x86_64 | ||
# os: macOS-latest | ||
# target: x86_64-apple-darwin | ||
# bin: oci-tester | ||
# name: oci-tester-Darwin-x86_64.tar.gz | ||
# | ||
# - release_for: macOS-aarch64 | ||
# os: macOS-latest | ||
# target: aarch64-apple-darwin | ||
# bin: oci-tester | ||
# name: oci-tester-Darwin-aarch64.tar.gz | ||
# | ||
# runs-on: ${{ matrix.platform.os }} | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# - name: Build binary | ||
# uses: houseabsolute/actions-rust-cross@v0 | ||
# with: | ||
# target: ${{ matrix.platform.target }} | ||
# args: "--locked --release" | ||
# strip: true | ||
# - name: Package as archive | ||
# shell: bash | ||
# run: | | ||
# cd target/${{ matrix.platform.target }}/release | ||
# if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then | ||
# 7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | ||
# else | ||
# tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | ||
# fi | ||
# cd - | ||
# - name: Generate SHA-256 | ||
# if: matrix.platform.os == 'macOS-latest' | ||
# run: shasum -a 256 ${{ matrix.platform.name }} | ||
# - name: Publish GitHub release | ||
# uses: softprops/action-gh-release@v1 | ||
# with: | ||
# files: "oci-tester-*" | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# if: startsWith( github.ref, 'refs/tags/v' ) | ||
- release_for: Linux-aarch64 | ||
os: ubuntu-latest | ||
target: aarch64-unknown-linux-musl | ||
bin: oci-tester | ||
name: oci-tester-Linux-aarch64-musl.tar.gz | ||
|
||
- release_for: Linux-arm | ||
os: ubuntu-latest | ||
target: arm-unknown-linux-musleabi | ||
bin: oci-tester | ||
name: oci-tester-Linux-arm-musl.tar.gz | ||
|
||
- release_for: Windows-i686 | ||
os: windows-latest | ||
target: i686-pc-windows-msvc | ||
bin: oci-tester.exe | ||
name: oci-tester-Windows-i686.zip | ||
|
||
- release_for: Windows-x86_64 | ||
os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
bin: oci-tester.exe | ||
name: oci-tester-Windows-x86_64.zip | ||
|
||
- release_for: macOS-x86_64 | ||
os: macOS-latest | ||
target: x86_64-apple-darwin | ||
bin: oci-tester | ||
name: oci-tester-Darwin-x86_64.tar.gz | ||
|
||
- release_for: macOS-aarch64 | ||
os: macOS-latest | ||
target: aarch64-apple-darwin | ||
bin: oci-tester | ||
name: oci-tester-Darwin-aarch64.tar.gz | ||
|
||
runs-on: ${{ matrix.platform.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install musl-tools | ||
run: sudo apt install -y musl-tools | ||
if: matrix.platform.os == 'ubuntu-latest' | ||
- name: Build binary | ||
uses: houseabsolute/actions-rust-cross@v0 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: "--locked --release" | ||
strip: true | ||
- name: Package as archive | ||
shell: bash | ||
run: | | ||
cd target/${{ matrix.platform.target }}/release | ||
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then | ||
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | ||
else | ||
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | ||
fi | ||
cd - | ||
- name: Generate SHA-256 | ||
if: matrix.platform.os == 'macOS-latest' | ||
run: shasum -a 256 ${{ matrix.platform.name }} | ||
- name: Publish GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "oci-tester-*" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith( github.ref, 'refs/tags/v' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.