From 8d9280bf982c184d85ee12c48084be9eccc2d6e9 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 7 Sep 2024 18:27:44 +1000 Subject: [PATCH] Change to gitea actions - remove .drone.yml - create .gitea/workflows/deploy.yaml - install node in default container --- .drone.yml | 39 --------------------------- .gitea/workflows/deploy.yaml | 52 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 39 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index e6a1fc3..0000000 --- a/.drone.yml +++ /dev/null @@ -1,39 +0,0 @@ -kind: pipeline -type: docker -name: almalinux8 - -trigger: - event: - include: - - push - - pull_request - -steps: - - name: build - image: git.query.consul/unkin/almalinux8:latest - commands: - # Install RPMFusion - - dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm - - dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm - - # Install the required packages using custom repositories - - dnf install -y golang gcc gcc-c++ make git sqlite-devel taglib-devel ffmpeg mpv rpmdevtools wget systemd sqlite taglib - - # Run the `make` command - - make build - - - name: upload - image: git.query.consul/unkin/almalinux8:latest - environment: - GITEA_PASSWORD: - from_secret: gitea_password - commands: - - > - for rpm in /drone/src/rpmbuild/RPMS/*/*.rpm; do - curl --user droneci:$GITEA_PASSWORD --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload - done - when: - branch: - - master - event: - - push diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..9309c2d --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,52 @@ +name: Build and Upload RPMs + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + name: Build on AlmaLinux 8 + runs-on: almalinux-8 + container: + image: git.query.consul/unkin/almalinux8:latest + steps: + - name: Install node + run: | + dnf module enable node:20 + dnf install -y node + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install RPMFusion + run: | + dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm + dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm + + - name: Install required packages + run: | + dnf install -y golang gcc gcc-c++ make git sqlite-devel taglib-devel ffmpeg mpv rpmdevtools wget systemd sqlite taglib + + - name: Build project + run: make build + + upload: + name: Upload RPMs + runs-on: almalinux-8 + needs: build + container: + image: git.query.consul/unkin/almalinux8:latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Upload RPMs to Gitea + env: + DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }} + run: | + for rpm in /drone/src/rpmbuild/RPMS/*/*.rpm; do + curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload + done