Skip to content

Commit

Permalink
Update upload/download-artifact to v4 in release.yml (#44)
Browse files Browse the repository at this point in the history
* Update release.yml

* Some minor improvements

* Fix release artifact uploading
  • Loading branch information
insolor authored Feb 13, 2024
1 parent fc6c28b commit 540b6eb
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Install linux build deps
if: matrix.os == 'ubuntu-latest'
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt install libxi-dev
sudo apt install libxtst-dev
Expand All @@ -34,18 +34,18 @@ jobs:
shell: bash
run: HOOK_VERSION=${{ github.sha }} cargo +nightly-2022-11-06 build --release

- name: Upload artifact (win)
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
- name: Upload artifact (windows)
uses: actions/upload-artifact@v4
if: startsWith(matrix.os, 'windows')
with:
name: artifact
name: artifact-windows
path: ./target/release/dfint_hook.dll

- name: Upload artifact (linux)
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
if: startsWith(matrix.os, 'ubuntu')
with:
name: artifact
name: artifact-linux
path: ./target/release/libdfint_hook.so

release:
Expand All @@ -56,25 +56,26 @@ jobs:
- uses: actions/checkout@v4

- name: Restore files
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
id: download
with:
name: artifact
path: ./
pattern: artifact-*
merge-multiple: true
path: release

- name: Fetch version from Cargo.toml
run: echo VERSION=$(cat Cargo.toml | awk -F'"' '/^version/ {print $2}') >> $GITHUB_ENV

- name: Rename files
run: |
mv ./dfint_hook.dll ./hook_${{ env.VERSION }}.dll
mv ./libdfint_hook.so ./hook_${{ env.VERSION }}.so
mv release/dfint_hook.dll release/hook_${{ env.VERSION }}.dll
mv release/libdfint_hook.so release/hook_${{ env.VERSION }}.so
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
hook_${{ env.VERSION }}.dll
hook_${{ env.VERSION }}.so
release/hook_${{ env.VERSION }}.dll
release/hook_${{ env.VERSION }}.so
tag_name: ${{ env.VERSION }}
draft: true

0 comments on commit 540b6eb

Please sign in to comment.