Merge pull request #9 from containeroo/renovate/amadvance-snapraid-12.x #51
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: build-snapraid | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare release tag | |
id: tag | |
run: | | |
# renovate: datasource=github-releases depName=amadvance/snapraid versioning=loose | |
SNAPRAID_VERSION=v12.3 | |
echo "SNAPRAID_VERSION_V=$(echo ${SNAPRAID_VERSION})" >> $GITHUB_ENV | |
echo "SNAPRAID_VERSION=$(echo ${SNAPRAID_VERSION} | cut -c 2-)" >> $GITHUB_ENV | |
- name: Build snapraid | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc git make checkinstall curl libblkid1 | |
URL=https://github.com/amadvance/snapraid/releases/download/${{ env.SNAPRAID_VERSION_V }}/snapraid-${{ env.SNAPRAID_VERSION }}.tar.gz | |
echo "download URL is: $URL" | |
sudo curl -LO $URL | |
sudo tar -xvf snapraid-${{ env.SNAPRAID_VERSION }}.tar.gz | |
cd snapraid-${{ env.SNAPRAID_VERSION }} | |
sudo ./configure | |
sudo make -j8 | |
sudo make -j8 check | |
sudo checkinstall -Dy --install=no --nodoc | |
sudo mkdir /build | |
sudo cp *.deb /build/snapraid-${{ env.SNAPRAID_VERSION }}.deb | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.SNAPRAID_VERSION_V }} | |
release_name: Release ${{ env.SNAPRAID_VERSION_V }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: /build/snapraid-${{ env.SNAPRAID_VERSION }}.deb | |
asset_name: snapraid-${{ env.SNAPRAID_VERSION }}.deb | |
asset_content_type: application/vnd.debian.binary-package |