build deb file #2
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: | ||
# tags: | ||
# - "v*.*.*" | ||
permissions: | ||
contents: write | ||
packages: write | ||
jobs: | ||
rpm-release: | ||
name: Create RPM release | ||
needs: [create-release] | ||
runs-on: ubuntu-latest | ||
# env: | ||
# RPM_VERSION: ${{ github.ref_name | cut -c 2- | sed -i 's/-/~/g' }} | ||
steps: | ||
- name: Checkout actions | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set RPM_VERSION | ||
run: | | ||
echo "RPM_VERSION=$(echo ${{ github.ref_name }} | cut -c 2- | sed 's/-/~/g')" >> $GITHUB_ENV | ||
- name: print RPM VERSION | ||
run: | | ||
echo RPM_VERSION=$RPM_VERSION | ||
- name: Install build dependencies | ||
run: | | ||
chmod +x ./.devcontainer/library-scripts/go-debian.sh | ||
sudo ./.devcontainer/library-scripts/go-debian.sh | ||
sudo apt-get install rpm | ||
- name: Build RPM | ||
run: | | ||
mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS | ||
git archive --format=tar.gz --prefix=dsmlpstorage-${{ env.RPM_VERSION }}/ -o ~/rpmbuild/SOURCES/dsmlpstorage-${{ env.RPM_VERSION }}.tar.gz HEAD | ||
ls -al ~/rpmbuild/SOURCES | ||
tar -ztvf ~/rpmbuild/SOURCES/dsmlpstorage-${{ env.RPM_VERSION }}.tar.gz | ||
cp rpm/dsmlpstorage.spec ~/rpmbuild/SPECS | ||
cd ~/rpmbuild | ||
rpmbuild -ba -vv --define "version ${{ env.RPM_VERSION }}" ~/rpmbuild/SPECS/dsmlpstorage.spec | ||
# - name: Upload RPM | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: dsmlpstorage-${{ env.RPM_VERSION }}-0.x86_64.rpm | ||
# path: /home/runner/rpmbuild/RPMS/x86_64/dsmlpstorage-${{ env.RPM_VERSION }}-0.x86_64.rpm | ||
- name: Release RPM | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: /home/runner/rpmbuild/RPMS/x86_64/dsmlpstorage-${{ env.RPM_VERSION }}-0.x86_64.rpm | ||
generate_release_notes: true | ||
token: ${{ secrets.GITHUB_TOKEN }} |