Compare commits

...

6 Commits

Author SHA1 Message Date
57cc17f8ac asd
asd
2025-02-28 20:13:00 -05:00
468bc28482 dummy file 2025-02-28 20:12:12 -05:00
78f964e9c4 add paths-ignore 2025-02-15 06:34:53 +03:00
552b175a48 checks for merge requests
All checks were successful
Build and Package OPKG / Build for "armv5-3.2" (push) Successful in 58s
Build and Package OPKG / Build for "armv7-2.6" (push) Successful in 59s
Build and Package OPKG / Build for "armv7-3.2" (push) Successful in 58s
Build and Package OPKG / Build for "aarch64-3.10" (push) Successful in 58s
Build and Package OPKG / Build for "mips-3.4" (push) Successful in 58s
Build and Package OPKG / Build for "mipsel-3.4" (push) Successful in 58s
2025-02-15 06:29:59 +03:00
4de4f1745f fix ci
All checks were successful
Build and Package OPKG / Build for "armv5-3.2" (push) Successful in 1m1s
Build and Package OPKG / Build for "armv7-2.6" (push) Successful in 1m0s
Build and Package OPKG / Build for "armv7-3.2" (push) Successful in 1m0s
Build and Package OPKG / Build for "armv5-3.2" (release) Successful in 1m21s
Build and Package OPKG / Build for "armv7-2.6" (release) Successful in 1m20s
Build and Package OPKG / Build for "armv7-3.2" (release) Successful in 1m18s
Build and Package OPKG / Build for "aarch64-3.10" (release) Successful in 1m20s
Build and Package OPKG / Build for "mips-3.4" (release) Successful in 1m22s
Build and Package OPKG / Build for "mipsel-3.4" (release) Successful in 1m17s
Build and Package OPKG / Build for "aarch64-3.10" (push) Successful in 59s
Build and Package OPKG / Build for "mipsel-3.4" (push) Successful in 59s
Build and Package OPKG / Build for "mips-3.4" (push) Successful in 58s
2025-02-15 06:25:47 +03:00
87ee5f5f9b Merge pull request 'Исправление CI сборок' (#2) from feature/pr_ci into main
All checks were successful
Build and Package OPKG / Build for aarch64-3.10 (release) Successful in 1m10s
Build and Package OPKG / Build for armv5-3.2 (release) Successful in 1m4s
Build and Package OPKG / Build for armv7-2.6 (release) Successful in 1m10s
Build and Package OPKG / Build for armv7-3.2 (release) Successful in 1m10s
Build and Package OPKG / Build for mips-3.4 (release) Successful in 1m10s
Build and Package OPKG / Build for mipsel-3.4 (release) Successful in 1m4s
2025-02-14 17:35:59 -05:00
5 changed files with 119 additions and 21 deletions

View File

@ -1,36 +1,44 @@
name: Build and Package OPKG name: Build and Package OPKG
on: on:
push:
branches:
- develop
- main
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/build-for-release.yml'
release: release:
types: [published] types: [published]
jobs: jobs:
build: build:
name: Build for ${{ matrix.arch }} name: Build for "${{ matrix.target }}"
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
include: include:
- arch: mipsel-3.4 - target: mipsel-3.4
goos: linux goos: linux
goarch: mipsle goarch: mipsle
gomips: softfloat gomips: softfloat
- arch: mips-3.4 - target: mips-3.4
goos: linux goos: linux
goarch: mips goarch: mips
gomips: softfloat gomips: softfloat
- arch: aarch64-3.10 - target: aarch64-3.10
goos: linux goos: linux
goarch: arm64 goarch: arm64
- arch: armv7-3.2 - target: armv7-3.2
goos: linux goos: linux
goarch: arm goarch: arm
goarm: 7 goarm: 7
- arch: armv7-2.6 - target: armv7-2.6
goos: linux goos: linux
goarch: arm goarch: arm
goarm: 7 goarm: 7
- arch: armv5-3.2 - target: armv5-3.2
goos: linux goos: linux
goarch: arm goarch: arm
goarm: 5 goarm: 5
@ -53,13 +61,30 @@ jobs:
- name: Build and Package - name: Build and Package
run: | run: |
ARCH=${{ matrix.arch }} GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} GOMIPS=${{ matrix.gomips }} GOARM=${{ matrix.goarm }} make TARGET=${{ matrix.target }} GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} GOMIPS=${{ matrix.gomips }} GOARM=${{ matrix.goarm }} make
- name: Fetching file list for artifact
if: ${{ github.event_name != 'release' }}
id: create_file_list
run: |
echo 'file_list<<EOF' >> $GITHUB_OUTPUT
find . -name "magitrickle_*_${{ matrix.target }}.ipk" -print >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Upload artifact
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ steps.create_file_list.outputs.file_list }}
if-no-files-found: error
- name: Upload asset to release - name: Upload asset to release
if: ${{ github.event_name == 'release' }}
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
files: |- files: |-
.build/magitrickle_*_${{ matrix.arch }}.ipk ./.build/magitrickle_*_${{ matrix.target }}.ipk
api_key: '${{secrets.RELEASE_TOKEN}}' api_key: '${{secrets.RELEASE_TOKEN}}'

57
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,57 @@
name: Checking
on:
pull_request:
branches:
- develop
- main
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/check.yml'
jobs:
check:
name: Finding suspicious constructs for ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: mipsel-3.4
goos: linux
goarch: mipsle
gomips: softfloat
- arch: mips-3.4
goos: linux
goarch: mips
gomips: softfloat
- arch: aarch64-3.10
goos: linux
goarch: arm64
- arch: armv7-3.2
goos: linux
goarch: arm
goarm: 7
- arch: armv7-2.6
goos: linux
goarch: arm
goarm: 7
- arch: armv5-3.2
goos: linux
goarch: arm
goarm: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Finding suspicious constructs
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} GOMIPS=${{ matrix.gomips }} GOARM=${{ matrix.goarm }} go vet ./...

View File

@ -3,28 +3,36 @@ APP_DESCRIPTION = DNS-based routing application
APP_MAINTAINER = Vladimir Avtsenov <vladimir.lsk.cool@gmail.com> APP_MAINTAINER = Vladimir Avtsenov <vladimir.lsk.cool@gmail.com>
COMMIT = $(shell git rev-parse --short HEAD) COMMIT = $(shell git rev-parse --short HEAD)
UPSTREAM_VERSION ?= $(shell git describe --tags --abbrev=0 2> /dev/null || echo $(COMMIT)) UPSTREAM_VERSION = $(shell git describe --tags --abbrev=0 2> /dev/null || echo "0.0.0")
OPKG_REVISION = ~git$(shell date +%Y%m%d).$(COMMIT)-1 PKG_REVISION ?= 1
ifeq ($(shell git rev-parse --abbrev-ref HEAD), main)
TAG = $(shell git describe --tags --abbrev=0 2> /dev/null || echo $(COMMIT)) TAG = $(shell git describe --tags --abbrev=0 2> /dev/null)
COMMITS_SINCE_TAG = $(shell git rev-list ${TAG}..HEAD --count || echo "0") COMMITS_SINCE_TAG = $(shell git rev-list ${TAG}..HEAD --count 2>/dev/null)
OPKG_REVISION = -$(shell expr $(COMMITS_SINCE_TAG) + 1) PRERELEASE_POSTFIX =
PRERELEASE_DATE = $(shell date +%Y%m%d)
ifneq ($(TAG),)
ifneq ($(COMMITS_SINCE_TAG), 0)
PRERELEASE_POSTFIX = ~git$(PRERELEASE_DATE).$(COMMIT)
endif
else
PRERELEASE_POSTFIX = ~git$(PRERELEASE_DATE).$(COMMIT)
endif endif
ARCH ?= mipsel-3.4 TARGET ?= mipsel-3.4
GOOS ?= linux GOOS ?= linux
GOARCH ?= mipsle GOARCH ?= mipsle
GOMIPS ?= softfloat GOMIPS ?= softfloat
GOARM ?= GOARM ?=
BUILD_DIR = ./.build BUILD_DIR = ./.build
PKG_DIR = $(BUILD_DIR)/$(ARCH) PKG_DIR = $(BUILD_DIR)/$(TARGET)
BIN_DIR = $(PKG_DIR)/data/opt/bin BIN_DIR = $(PKG_DIR)/data/opt/bin
PARAMS = -v -a -trimpath -ldflags="-X 'magitrickle/constant.Version=$(UPSTREAM_VERSION)$(OPKG_REVISION)' -X 'magitrickle/constant.Commit=$(COMMIT)' -w -s" PARAMS = -v -a -trimpath -ldflags="-X 'magitrickle/constant.Version=$(UPSTREAM_VERSION)$(PRERELEASE_POSTFIX)' -X 'magitrickle/constant.Commit=$(COMMIT)' -w -s"
all: clear build_daemon package all: clear build_daemon package
clear: clear:
echo $(shell git rev-parse --abbrev-ref HEAD)
rm -rf $(PKG_DIR) rm -rf $(PKG_DIR)
build_daemon: build_daemon:
@ -34,8 +42,8 @@ package:
@mkdir -p $(PKG_DIR)/control @mkdir -p $(PKG_DIR)/control
@echo '2.0' > $(PKG_DIR)/debian-binary @echo '2.0' > $(PKG_DIR)/debian-binary
@echo 'Package: $(APP_NAME)' > $(PKG_DIR)/control/control @echo 'Package: $(APP_NAME)' > $(PKG_DIR)/control/control
@echo 'Version: $(UPSTREAM_VERSION)$(OPKG_REVISION)' >> $(PKG_DIR)/control/control @echo 'Version: $(UPSTREAM_VERSION)$(PRERELEASE_POSTFIX)-$(PKG_REVISION)' >> $(PKG_DIR)/control/control
@echo 'Architecture: $(ARCH)' >> $(PKG_DIR)/control/control @echo 'Architecture: $(TARGET)' >> $(PKG_DIR)/control/control
@echo 'Maintainer: $(APP_MAINTAINER)' >> $(PKG_DIR)/control/control @echo 'Maintainer: $(APP_MAINTAINER)' >> $(PKG_DIR)/control/control
@echo 'Description: $(APP_DESCRIPTION)' >> $(PKG_DIR)/control/control @echo 'Description: $(APP_DESCRIPTION)' >> $(PKG_DIR)/control/control
@echo 'Section: net' >> $(PKG_DIR)/control/control @echo 'Section: net' >> $(PKG_DIR)/control/control
@ -44,4 +52,4 @@ package:
@cp -r ./opt $(PKG_DIR)/data/ @cp -r ./opt $(PKG_DIR)/data/
@fakeroot sh -c "tar -C $(PKG_DIR)/control -czvf $(PKG_DIR)/control.tar.gz ." @fakeroot sh -c "tar -C $(PKG_DIR)/control -czvf $(PKG_DIR)/control.tar.gz ."
@fakeroot sh -c "tar -C $(PKG_DIR)/data -czvf $(PKG_DIR)/data.tar.gz ." @fakeroot sh -c "tar -C $(PKG_DIR)/data -czvf $(PKG_DIR)/data.tar.gz ."
@tar -C $(PKG_DIR) -czvf $(BUILD_DIR)/$(APP_NAME)_$(UPSTREAM_VERSION)$(OPKG_REVISION)_$(ARCH).ipk ./debian-binary ./control.tar.gz ./data.tar.gz @tar -C $(PKG_DIR) -czvf $(BUILD_DIR)/$(APP_NAME)_$(UPSTREAM_VERSION)$(PRERELEASE_POSTFIX)-$(PKG_REVISION)_$(TARGET).ipk ./debian-binary ./control.tar.gz ./data.tar.gz

1
asd Normal file
View File

@ -0,0 +1 @@
sad

7
cmd/magitrickle/main.go Normal file
View File

@ -0,0 +1,7 @@
package magitrickle
import "fmt"
func main() {
fmt.Println("dummy file")
}