feat: Initial Project 🎉 🚀

This commit is contained in:
2024-07-22 22:26:15 +12:00
commit d15f1b72b3
5 changed files with 112 additions and 0 deletions

24
.github/build.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: CI
on:
push:
branches:
- "**"
tags:
- "!**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release if required
run: |
/usr/local/bin/semantic-release --version-file \
--changelog .generated-go-semantic-release-changelog.md \
--hooks exec \
--provider=gitea
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}

38
.github/release.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: CI
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Get Vars
run: |
echo ${GITHUB_REF_NAME}
echo ${GITHUB_REF_TYPE}
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: >
linux/amd64,
linux/arm64
push: true
tags: >
${{ secrets.DOCKERHUB_USERNAME }}/ubuntu:act_gitea-latest,
${{ secrets.DOCKERHUB_USERNAME }}/ubuntu:act_gitea:${{ env.GITHUB_REF_NAME }}

22
.semrelrc Normal file
View File

@@ -0,0 +1,22 @@
{
"plugins": {
"provider": {
"name": "gitea"
},
"changelog-generator": {
"name": "default",
"options": {
"emojis": "true"
}
},
"hooks": {
"names": [
"exec"
],
"options": {
"exec_on_success": "",
"exec_on_no_release": "echo {{.Reason}}: {{.Message}}"
}
}
}
}

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM ghcr.io/catthehacker/ubuntu:act-22.04
ARG GITEA_PROVIDER_VER="1.0.13"
COPY scripts/go-semantic-release.sh /usr/local/bin/semantic-release
# Install Go Semantic Release, also Gitea plugin
RUN curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o /usr/local/bin/go-semantic-release && \
chmod +x /usr/local/bin/go-semantic-release && \
/usr/local/bin/semantic-release \
--download-plugins \
--show-progress \
--provider git \
--hooks exec && \
mkdir -p /tmp/.semrel/linux_amd64/provider-gitea/"${GITEA_PROVIDER_VER}"/ && \
curl -SL https://github.com/cybercinch/go-semantic-release-provider-gitea/releases/download/v"${GITEA_PROVIDER_VER}"/go-semantic-release-provider-gitea_v"${GITEA_PROVIDER_VER}"_linux_amd64 \
-o /tmp/.semrel/linux_amd64/provider-gitea/"${GITEA_PROVIDER_VER}"/gitea && \
chmod a+x /tmp/.semrel/linux_amd64/provider-gitea/"${GITEA_PROVIDER_VER}"/gitea

12
scripts/go-semantic-release.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
################################
# Wrapper script for go-semantic-release
# This is to allow use of cached plugin versions in
# standard container for Gitea Actions runner.
################################
# Copy pre-loaded plugins
cp -Rf /tmp/.semrel "$(pwd)"/;
# Execute semantic-release and expand parameters
/usr/local/bin/go-semantic-release "$@"