Files
ALR/.gitea/workflows/release.yaml
Евгений (ХрамычЪ) Храмов c9639b7073
Some checks failed
Pre-commit / pre-commit (push) Has been cancelled
Create Release / changelog (push) Successful in 3m6s
изменение способа определения имён для добавления в релиз
2025-08-27 12:22:22 +03:00

133 lines
4.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ALR - Any Linux Repository
# Copyright (C) 2025 The ALR Authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
name: Create Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Get Changes between Tags
id: changes
uses: simbo/changes-between-tags-action@v1
- name: Set version
run: |
version=$(echo "${GITHUB_REF##*/}" | sed 's/^v//')
echo "Version - $version"
echo "VERSION=$version" >> $GITHUB_ENV
- name: Prepare for install
run: |
apt-get update
- name: Build alr
env:
IGNORE_ROOT_CHECK: 1
run: |
make build
- name: Create tar.gz
run: |
mkdir -p ./out/completion
cp alr ./out
cp scripts/completion/bash ./out/completion/alr
cp scripts/completion/zsh ./out/completion/_alr
( cd out && tar -czvf ../alr-${{ env.VERSION }}-linux-x86_64.tar.gz * )
- name: Release
uses: akkuman/gitea-release-action@v1
with:
body: ${{ steps.changes.outputs.changes }}
files: |-
alr-${{ env.VERSION }}-linux-x86_64.tar.gz
- name: Checkout alr-default repository
uses: actions/checkout@v4
with:
repository: Plemya-x/alr-default
token: ${{ secrets.GITEAPUBLIC }}
path: alr-default
- name: Update version in alr-bin
run: |
# Замените значения в файле с конфигурацией
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
- name: Install alr
env:
CREATE_SYSTEM_RESOURCES: 0
run: |
make install
- name: Prepare directories for ALR
run: |
# Создаём необходимые директории для работы alr build
mkdir -p /tmp/alr/dl /tmp/alr/pkgs /var/cache/alr
chmod -R 777 /tmp/alr
chmod -R 755 /var/cache/alr
- name: Build packages
run: |
SCRIPT_PATH=alr-default/alr-bin/alr.sh
ALR_DISTRO=altlinux ALR_PKG_FORMAT=rpm alr build -s "$SCRIPT_PATH"
ALR_PKG_FORMAT=rpm alr build -s "$SCRIPT_PATH"
ALR_PKG_FORMAT=deb alr build -s "$SCRIPT_PATH"
ALR_PKG_FORMAT=archlinux alr build -s "$SCRIPT_PATH"
- name: Collect built packages
id: collect_files
run: |
echo "Looking for packages in /tmp/alr/pkgs/:"
find /tmp/alr/pkgs/ -name "*.deb" -o -name "*.rpm" -o -name "*.pkg.tar.zst" 2>/dev/null | head -10
# Копируем пакеты в текущую директорию
find /tmp/alr/pkgs/ -name "*.deb" -exec cp {} . \; 2>/dev/null || true
find /tmp/alr/pkgs/ -name "*.rpm" -exec cp {} . \; 2>/dev/null || true
find /tmp/alr/pkgs/ -name "*.pkg.tar.zst" -exec cp {} . \; 2>/dev/null || true
# Проверяем что получилось
echo "Package files in current directory:"
ls -la *.deb *.rpm *.pkg.tar.zst 2>/dev/null || echo "No package files found in current dir"
# Сохраняем список файлов для загрузки
echo "files<<EOF" >> $GITHUB_OUTPUT
ls -1 *.deb *.rpm *.pkg.tar.zst 2>/dev/null || true
echo "EOF" >> $GITHUB_OUTPUT
- name: Upload assets
uses: akkuman/gitea-release-action@v1
with:
body: ${{ steps.changes.outputs.changes }}
files: ${{ steps.collect_files.outputs.files }}