Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lwshang committed Sep 14, 2022
1 parent 8498335 commit cff05c1
Showing 1 changed file with 39 additions and 34 deletions.
73 changes: 39 additions & 34 deletions .github/workflows/release-optimizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jobs:
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 0.3.4
release_name: 0.3.4

build:
build-release:
name: build-release
needs: ["create-release"]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -37,42 +42,42 @@ jobs:
binary_path: target/x86_64-pc-windows-msvc/release/ic-cdk-optimizer.exe

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.rust-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.rust-version }}

- name: Run builds
run: |
cargo build -p ic-cdk-optimizer --release
- name: Run builds
run: |
cargo build -p ic-cdk-optimizer --release
- name: Strip release binary (linux and macos)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: strip "${{ matrix.binary_path }}"
- name: Strip release binary (linux and macos)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: strip "${{ matrix.binary_path }}"

- name: Create archives
run: |
staging="ic-cdk-optimizer-0.3.4-${{ matrix.target }}"
mkdir -p "$staging"
cp "${{ matrix.binary_path }}" "$staging/"
- name: Create archives
run: |
staging="ic-cdk-optimizer-0.3.4-${{ matrix.target }}"
mkdir -p "$staging"
cp "${{ matrix.binary_path }}" "$staging/"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a "$staging.zip" "$staging"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a "$staging.zip" "$staging"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream
- name: Upload release archive
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream

0 comments on commit cff05c1

Please sign in to comment.