Skip to content

Commit

Permalink
Merge pull request #75 from Luni-4/improve-deploy
Browse files Browse the repository at this point in the history
Improve deploy actions
  • Loading branch information
jfrimmel committed Feb 15, 2023
2 parents 43b31c9 + e78572d commit 094d3a1
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ jobs:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true

- name: Build cargo-valgrind
run: |
Expand All @@ -29,8 +27,8 @@ jobs:
shell: bash
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "::set-output name=tag::$VERSION"
VERSION=$(cargo pkgid | cut -d# -f2)
echo "tag=$VERSION" >> $GITHUB_OUTPUT
- name: Build package
id: package
Expand All @@ -40,8 +38,8 @@ jobs:
ARCHIVE_NAME="cargo-valgrind-${{ steps.tagName.outputs.tag }}-$ARCHIVE_TARGET"
ARCHIVE_FILE="${ARCHIVE_NAME}.zip"
7z a ${ARCHIVE_FILE} ./target/release/cargo-valgrind.exe
echo "::set-output name=file::${ARCHIVE_FILE}"
echo "::set-output name=name::${ARCHIVE_NAME}.zip"
echo "file=$ARCHIVE_FILE" >> $GITHUB_OUTPUT
echo "name=$ARCHIVE_NAME.zip" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand All @@ -65,13 +63,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Install musl
if: contains(matrix.target, 'linux-musl')
Expand All @@ -91,17 +87,17 @@ jobs:
- name: Get the version
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "::set-output name=tag::$VERSION"
VERSION=$(cargo pkgid | cut -d# -f2)
echo "tag=$VERSION" >> $GITHUB_OUTPUT
- name: Build package
id: package
run: |
TAR_FILE=cargo-valgrind-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}
cd target/${{ matrix.target }}/release
tar -czvf $GITHUB_WORKSPACE/$TAR_FILE.tar.gz cargo-valgrind
echo ::set-output "name=name::${TAR_FILE}"
echo ::set-output "name=file::${TAR_FILE}.tar.gz "
echo "name=$TAR_FILE" >> $GITHUB_OUTPUT
echo "file=$TAR_FILE.tar.gz" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand All @@ -120,11 +116,9 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true

- name: Create Cargo.lock
run: |
Expand All @@ -133,8 +127,8 @@ jobs:
- name: Get version
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "::set-output name=tag::$VERSION"
VERSION=$(cargo pkgid | cut -d# -f2)
echo "tag=$VERSION" >> $GITHUB_OUTPUT
- name: Download artifacts
uses: actions/download-artifact@v2
Expand Down

0 comments on commit 094d3a1

Please sign in to comment.