57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
name: Build
|
|
on: [push]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build_arch:
|
|
runs-on: archlinux
|
|
steps:
|
|
|
|
- name: Checkout Current Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Clone External Repository
|
|
run: |
|
|
git clone https://git.elordenador.org/RedSocial/cli_archpkg.git external
|
|
chown -R builder:builder external
|
|
- name: Makepkg
|
|
run: |
|
|
cd external && makepkg -s --noconfirm
|
|
- name: Extract package version
|
|
id: pkg_version
|
|
run: |
|
|
PKGFILE=$(ls external/*.pkg.tar.zst)
|
|
PKGVERSION=$(basename "$PKGFILE" | sed 's/^.*-\([0-9.]*\)-x86_64\.pkg\.tar\.zst$/\1/')
|
|
echo "PKGVERSION=$PKGVERSION" >> $GITHUB_ENV
|
|
echo "version=$PKGVERSION" >> $GITHUB_OUTPUT
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: arch-package
|
|
path: external/*.pkg.tar.zst
|
|
publish-release:
|
|
runs-on: ubuntu-26.04
|
|
needs: build_arch
|
|
steps:
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: arch-package
|
|
path: ./dist
|
|
- name: Create Git Tag
|
|
run: |
|
|
git tag ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
|
git push origin ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
|
- name: Create Release and Upload Assets
|
|
uses: https://github.com/softprops/action-gh-release@v1
|
|
with:
|
|
files: ./dist/*.pkg.tar.zst
|
|
tag_name: ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|