Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi committed Sep 6, 2024
1 parent 9a3b3f6 commit 3ecc005
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,20 @@ jobs:
strategy:
fail-fast: false
matrix:
profile: ["dev", "release"]
os: ["ubuntu-latest"]
use-cross: [false]
include:
- target: aarch64-unknown-linux-gnu
profile: ["release"]
platform:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use-cross: true
- target: aarch64-unknown-linux-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
use-cross: true
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-cross: false
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: false
# - os: macos-latest
# target: aarch64-apple-darwin
# - os: macos-latest
Expand All @@ -64,7 +68,7 @@ jobs:
# target: x86_64-pc-windows-msvc
# - os: windows-latest
# target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.platform.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
Expand All @@ -73,7 +77,7 @@ jobs:
shell: bash -xe {0}
steps:
- name: Install musl tools
if: matrix.target == 'x86_64-unknown-linux-musl'
if: matrix.platform.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get install -y musl-tools --no-install-recommends
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -83,20 +87,20 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target }}
target: ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
key: ${{ matrix.target }}
key: ${{ matrix.platform.target }}
- name: Install cross
if: ${{ !matrix.os && matrix.use-cross }}
if: ${{ matrix.platform.use-cross }}
uses: taiki-e/install-action@f2b65a3e67b2ba5ed3b4a631b5e460896e975708 # v2.42.37
with:
tool: cross

- run: ${{ (matrix.use-cross) && 'cross' || 'cargo' }} rustc --locked ${{ github.ref_name == github.event.repository.default_branch && '--release' || '' }} --target=${{ matrix.target }} -- --emit=link=dist/${{ needs.env.outputs.BINARY_NAME }}
- run: ${{ (matrix.platform.use-cross) && 'cross' || 'cargo' }} rustc --locked ${{ github.ref_name == github.event.repository.default_branch && '--release' || '' }} --target=${{ matrix.platform.target }} -- --emit=link=dist/${{ needs.env.outputs.BINARY_NAME }}
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ matrix.target }}
name: ${{ matrix.platform.target }}
path: |
dist/${{ needs.env.outputs.BINARY_NAME }}
dist/${{ needs.env.outputs.BINARY_NAME }}.exe
Expand All @@ -107,13 +111,13 @@ jobs:
working-directory: dist/
run: |
if [ -e ${{ needs.env.outputs.BINARY_NAME }}.exe ]; then
filename="${{ needs.env.outputs.BINARY_NAME }}-${{ inputs.tag-name }}-${{ matrix.target }}.exe"
filename="${{ needs.env.outputs.BINARY_NAME }}-${{ inputs.tag-name }}-${{ matrix.platform.target }}.exe"
mv ${{ needs.env.outputs.BINARY_NAME }}.exe "$filename"
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.target }} --clobber
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.platform.target }} --clobber
else
filename="${{ needs.env.outputs.BINARY_NAME }}-${{ inputs.tag-name }}-${{ matrix.target }}"
filename="${{ needs.env.outputs.BINARY_NAME }}-${{ inputs.tag-name }}-${{ matrix.platform.target }}"
mv ${{ needs.env.outputs.BINARY_NAME }} "$filename"
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.target }} --clobber
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.platform.target }} --clobber
fi
image:
Expand Down

0 comments on commit 3ecc005

Please sign in to comment.