feature test
This commit is contained in:
@ -10,37 +10,16 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PKG: ${{ github.event.inputs.package }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Read version
|
||||
- name: Build and publish
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
echo "VERSION=$(cat ${PKG}/VERSION | tr -d '[:space:]')" >> $GITHUB_ENV
|
||||
|
||||
- name: Download upstream
|
||||
run: |
|
||||
cd ${PKG}
|
||||
bash scripts/download.sh "$VERSION"
|
||||
|
||||
- name: Build deb
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "$PWD/${PKG}:/work" \
|
||||
-w /work \
|
||||
-e VERSION="$VERSION" \
|
||||
goreleaser/nfpm package \
|
||||
--config nfpm.yaml \
|
||||
--target /work \
|
||||
--packager deb
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
DEB=$(ls ${PKG}/*.deb | head -1)
|
||||
HTTP_CODE=$(curl -s -o /tmp/resp.txt -w "%{http_code}" \
|
||||
--user "andrew:${{ secrets.GITEA_TOKEN }}" \
|
||||
--upload-file "$DEB" \
|
||||
"https://git.nakolenke.org/api/packages/nakolenke-pub/debian/pool/trixie/main/upload")
|
||||
cat /tmp/resp.txt
|
||||
[ "$HTTP_CODE" = "201" ] || exit 1
|
||||
make -C ${{ github.event.inputs.package }} \
|
||||
GITEA_USER=andrew \
|
||||
GITEA_URL=https://git.nakolenke.org \
|
||||
GITEA_ORG=nakolenke-pub \
|
||||
SUITE=trixie \
|
||||
package publish
|
||||
|
||||
34
Makefile
Normal file
34
Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
NFPM= docker run --rm -v $(PWD)/$(PORTNAME):/work -w /work -e VERSION=$(VERSION) goreleaser/nfpm
|
||||
DISTDIR= $(PORTNAME)/dist
|
||||
FETCH= wget -q
|
||||
|
||||
all: fetch build package
|
||||
|
||||
fetch:
|
||||
@echo ">>> Fetching $(DISTFILE)"
|
||||
@$(FETCH) "$(MASTER_SITE)/$(DISTFILE)" -O /tmp/$(DISTFILE)
|
||||
@mkdir -p $(DISTDIR)
|
||||
@unzip -q /tmp/$(DISTFILE) -d $(DISTDIR)/
|
||||
@chmod +x $(DISTDIR)/v2ray
|
||||
@rm /tmp/$(DISTFILE)
|
||||
|
||||
build:
|
||||
@echo ">>> Building $(PORTNAME)-$(VERSION).deb"
|
||||
@$(NFPM) package --config nfpm.yaml --target /work --packager deb
|
||||
|
||||
package: fetch build
|
||||
|
||||
publish:
|
||||
@echo ">>> Publishing $(PORTNAME)-$(VERSION)_amd64.deb"
|
||||
@DEB=$$(ls $(PORTNAME)/*.deb | head -1) && \
|
||||
HTTP_CODE=$$(curl -s -o /tmp/resp.txt -w "%{http_code}" \
|
||||
--user "$(GITEA_USER):$(GITEA_TOKEN)" \
|
||||
--upload-file "$$DEB" \
|
||||
"$(GITEA_URL)/api/packages/$(GITEA_ORG)/debian/pool/$(SUITE)/main/upload") && \
|
||||
cat /tmp/resp.txt && \
|
||||
[ "$$HTTP_CODE" = "201" ] || exit 1
|
||||
|
||||
clean:
|
||||
@rm -rf $(PORTNAME)/dist $(PORTNAME)/*.deb
|
||||
|
||||
.PHONY: all fetch build package publish clean
|
||||
7
v2ray/Makefile
Normal file
7
v2ray/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
PORTNAME= v2ray
|
||||
VERSION!= cat VERSION
|
||||
DISTNAME= v2ray-linux-64
|
||||
DISTFILE= $(DISTNAME).zip
|
||||
MASTER_SITE= https://github.com/v2fly/v2ray-core/releases/download/v$(VERSION)
|
||||
|
||||
.include "../Makefile"
|
||||
Reference in New Issue
Block a user