This commit is contained in:
		| @@ -52,6 +52,8 @@ jobs: | |||||||
|           apt-get update && apt-get install -y libcap2-bin |           apt-get update && apt-get install -y libcap2-bin | ||||||
|  |  | ||||||
|       - name: Build alr |       - name: Build alr | ||||||
|  |         env: | ||||||
|  |           IGNORE_ROOT_CHECK: 1 | ||||||
|         run: | |         run: | | ||||||
|           make build |           make build | ||||||
|  |  | ||||||
| @@ -84,18 +86,11 @@ jobs: | |||||||
|           sed -i "s/version='[0-9]\+\.[0-9]\+\.[0-9]\+'/version='${{ env.VERSION }}'/g" alr-default/alr-bin/alr.sh |           sed -i "s/version='[0-9]\+\.[0-9]\+\.[0-9]\+'/version='${{ env.VERSION }}'/g" alr-default/alr-bin/alr.sh | ||||||
|           sed -i "s/release='[0-9]\+'/release='1'/g" alr-default/alr-bin/alr.sh |           sed -i "s/release='[0-9]\+'/release='1'/g" alr-default/alr-bin/alr.sh | ||||||
|  |  | ||||||
|       - name: Commit changes |  | ||||||
|         run: | |  | ||||||
|           cd alr-default |  | ||||||
|           git config user.name "gitea" |  | ||||||
|           git config user.email "admin@plemya-x.ru" |  | ||||||
|           git add . |  | ||||||
|           git commit -m "Обновление версии до ${{ env.VERSION }}" |  | ||||||
|           git push |  | ||||||
|  |  | ||||||
|       - name: Install alr |       - name: Install alr | ||||||
|         run: | |         run: | | ||||||
|           make install |           make install | ||||||
|  |           # temporary fix | ||||||
|  |           groupadd wheel | ||||||
|  |  | ||||||
|       - name: Build packages |       - name: Build packages | ||||||
|         run: | |         run: | | ||||||
| @@ -114,3 +109,12 @@ jobs: | |||||||
|             alr-bin+alr-default-${{ env.VERSION }}-1-x86_64.pkg.tar.zst \ |             alr-bin+alr-default-${{ env.VERSION }}-1-x86_64.pkg.tar.zst \ | ||||||
|             alr-bin+alr-default-${{ env.VERSION }}-1.red80.x86_64.rpm \ |             alr-bin+alr-default-${{ env.VERSION }}-1.red80.x86_64.rpm \ | ||||||
|             alr-bin+alr-default-${{ env.VERSION }}-alt1.x86_64.rpm |             alr-bin+alr-default-${{ env.VERSION }}-alt1.x86_64.rpm | ||||||
|  |  | ||||||
|  |       - name: Commit changes | ||||||
|  |         run: | | ||||||
|  |           cd alr-default | ||||||
|  |           git config user.name "gitea" | ||||||
|  |           git config user.email "admin@plemya-x.ru" | ||||||
|  |           git add . | ||||||
|  |           git commit -m "Обновление версии до ${{ env.VERSION }}" | ||||||
|  |           git push | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Makefile
									
									
									
									
									
								
							| @@ -24,7 +24,7 @@ $(BIN): | |||||||
| 	go build -ldflags="-X 'gitea.plemya-x.ru/Plemya-x/ALR/internal/config.Version=$(GIT_VERSION)'" -o $@ | 	go build -ldflags="-X 'gitea.plemya-x.ru/Plemya-x/ALR/internal/config.Version=$(GIT_VERSION)'" -o $@ | ||||||
|  |  | ||||||
| check-no-root: | check-no-root: | ||||||
| 	@if [[ "$(IGNORE_ROOT_CHECK)" != "1" ]] && [[ "$$(whoami)" == 'root' ]]; then \ | 	@if [ "$$IGNORE_ROOT_CHECK" != "1" ] && [ "`whoami`" = "root" ]; then \ | ||||||
| 		echo "This target shouldn't run as root" 1>&2; \ | 		echo "This target shouldn't run as root" 1>&2; \ | ||||||
| 		echo "Set IGNORE_ROOT_CHECK=1 to override" 1>&2; \ | 		echo "Set IGNORE_ROOT_CHECK=1 to override" 1>&2; \ | ||||||
| 		exit 1; \ | 		exit 1; \ | ||||||
| @@ -39,9 +39,12 @@ install: \ | |||||||
| $(INSTALED_BIN): $(BIN) | $(INSTALED_BIN): $(BIN) | ||||||
| 	install -Dm755 $< $@ | 	install -Dm755 $< $@ | ||||||
| 	setcap cap_setuid,cap_setgid+ep $(INSTALED_BIN) | 	setcap cap_setuid,cap_setgid+ep $(INSTALED_BIN) | ||||||
| 	id -u alr &>/dev/null || useradd -r -s /usr/sbin/nologin alr | 	@if id alr >/dev/null 2>&1; then \ | ||||||
| 	mkdir -p /var/cache/alr /etc/alr | 		echo "User 'alr' already exists. Skipping."; \ | ||||||
| 	chown alr:alr /var/cache/alr /etc/alr | 	else \ | ||||||
|  | 		useradd -r -s /usr/sbin/nologin alr; \ | ||||||
|  | 	fi | ||||||
|  | 	install -d -o alr -g alr -m 755 /var/cache/alr /etc/alr | ||||||
|  |  | ||||||
| $(INSTALLED_BASH_COMPLETION): $(BASH_COMPLETION) | $(INSTALLED_BASH_COMPLETION): $(BASH_COMPLETION) | ||||||
| 	install -Dm755 $< $@ | 	install -Dm755 $< $@ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user