fixup zip structure #11
Workflow file for this run
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
name: Release | |
on: | |
push: | |
branches: | |
- master | |
- test/release | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
name: Build ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
# checkout code | |
- uses: actions/checkout@v4 | |
# install just | |
- uses: extractions/setup-just@v1 | |
# install rust | |
- run: rustup show && rustup target add ${{ matrix.target }} | |
# install dependencies | |
- run: just setup | |
# build (generates binaries) | |
- run: just build --locked --release --target=${{ matrix.target }} | |
- run: cargo test --release --locked manpage | |
# create archive | |
- name: Archive | |
shell: bash | |
run: | | |
staging="istat-${{ matrix.target }}" | |
mkdir "$staging" | |
cp -a "doc/*" "$staging" | |
files=( | |
"target/${{ matrix.target }}/release/istat" | |
"target/${{ matrix.target }}/release/istat-ipc" | |
"target/${{ matrix.target }}/release/istat-acpi" | |
"target/${{ matrix.target }}/release/istat-sensors" | |
"target/${{ matrix.target }}/release/istat-signals" | |
"README.md" | |
"sample_config.toml" | |
"sample_included_config.toml" | |
"LICENSE" | |
) | |
for file in ${files[@]}; do | |
cp $file "$staging" | |
done | |
zip "$staging.zip" "$staging" | |
# upload zip as an artifact (as a folder called `artifact`) | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: istat-${{ matrix.target }}.zip | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
# downloads artifacts (this downloads the folder called `artifacts` defined above) | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: . | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
artifacts/istat-x86_64-unknown-linux-gnu.zip | |
tag_name: ${{ github.run_number }} | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |