-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Moving deb/rpm packaging step around
Signed-off-by: Tyler Erickson <[email protected]>
- Loading branch information
1 parent
f3c7b5f
commit 1a33017
Showing
1 changed file
with
16 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,6 +288,22 @@ jobs: | |
meson setup build -Dprefix=/ -Dmandir=/man -Dbindir=/ ${{ matrix.config.meson_opts }} --buildtype=release | ||
meson install -C build | ||
#NOTE: Moved to before creating tar file due to how we set permissions to create the tar | ||
- name: Create packages | ||
if: ${{ matrix.config.create_package }} | ||
working-directory: ${{ format('build/{0}', env.DESTDIR) }} | ||
run: | # https://nfpm.goreleaser.com/install/ | ||
go install github.com/goreleaser/nfpm/v2/cmd/[email protected] | ||
if [[ ${{ github.ref }} =~ ^refs/tags/v[0-9\.]+$ ]]; then | ||
version=$(echo ${{ github.ref_name }} | tr -d 'v') | ||
else | ||
version=$(printf "%s-dev" $(date +'%y.%m.%d')) | ||
fi | ||
sed -i '/version:/ s/"[^"][^"]*"/"'"$version"'"/' ../../nfpm.yaml | ||
nfpm package -f ../../nfpm.yaml -p deb -t .. | ||
nfpm package -f ../../nfpm.yaml -p rpm -t .. | ||
shell: bash | ||
|
||
- name: Set ownership of executables to root:root | ||
if: ${{ matrix.config.os != 'windows-latest' }} | ||
run: sudo chown -R root:root build | ||
|
@@ -315,26 +331,6 @@ jobs: | |
go-version: 'stable' | ||
cache: false | ||
|
||
- name: Create packages | ||
if: ${{ matrix.config.create_package }} | ||
working-directory: ${{ format('build/{0}', env.DESTDIR) }} | ||
run: | # https://nfpm.goreleaser.com/install/ | ||
go install github.com/goreleaser/nfpm/v2/cmd/[email protected] | ||
if [[ ${{ github.ref }} =~ ^refs/tags/v[0-9\.]+$ ]]; then | ||
version=$(echo ${{ github.ref_name }} | tr -d 'v') | ||
else | ||
version=$(printf "%s-dev" $(date +'%y.%m.%d')) | ||
fi | ||
#Change ownership back before running deb/rpm creation | ||
CURRENT_USER=$(whoami) | ||
CURRENT_UID=$(getent passwd "$CURRENT_USER" | cut -d: -f3) | ||
CURRENT_GID=$(getent passwd "$CURRENT_USER" | cut -d: -f4) | ||
sudo chown -R $CURRENT_UID:$CURRENT_GID $DESTDIR | ||
sed -i '/version:/ s/"[^"][^"]*"/"'"$version"'"/' ../../nfpm.yaml | ||
nfpm package -f ../../nfpm.yaml -p deb -t .. | ||
nfpm package -f ../../nfpm.yaml -p rpm -t .. | ||
shell: bash | ||
|
||
- name: Generate Hashes | ||
if: ${{ matrix.config.publish_release }} | ||
shell: bash | ||
|