mirror of
https://github.com/kemko/xc.git
synced 2026-01-01 15:55:43 +03:00
added ci (#14)
* add .github/workflows/build.yml add Makefile go.mod: add govvv go.sum: add govvv * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * fix .github/workflows/build.yml * remote/serial.go "panic: bytes: negative Repeat count" * fix .github/workflows/build.yml * fix .github/workflows/build.yml * remove cache * add .github/workflows/release.yml * add .github/workflows/release.yml * .github/workflows/build.yml enable ARM * remote/serial.go fix syscall.Dup2 for ARM
This commit is contained in:
38
.github/workflows/build.yml
vendored
Normal file
38
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
on: [push]
|
||||
|
||||
name: build
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
arch:
|
||||
- amd64
|
||||
- arm64
|
||||
os:
|
||||
- linux
|
||||
go-version:
|
||||
- 1.15
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
|
||||
# build {{
|
||||
- name: make deps
|
||||
run: make deps
|
||||
- name: make build
|
||||
run: make build CGO_ENABLED=0 GOARCH=${{ matrix.arch }} GOVVV_PKG=${{ github.repository_owner }}/${{ github.event.repository.name }}
|
||||
# }}
|
||||
|
||||
- name: debug
|
||||
run: |
|
||||
ls -al
|
||||
ls -al deps/
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: xc.${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: bin/xc
|
||||
127
.github/workflows/release.yml
vendored
Normal file
127
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
name: release
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
name: create release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
steps:
|
||||
- name: create release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: create_release
|
||||
strategy:
|
||||
matrix:
|
||||
arch:
|
||||
- amd64
|
||||
#- arm64
|
||||
os:
|
||||
- linux
|
||||
go-version:
|
||||
- 1.15
|
||||
include:
|
||||
- arch: amd64
|
||||
rpm_arch: x86_64
|
||||
# - arch: arm64
|
||||
# rpm_arch: aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
|
||||
# build {{
|
||||
- name: make deps
|
||||
run: make deps
|
||||
- name: make build
|
||||
run: make build CGO_ENABLED=0 GOARCH=${{ matrix.arch }} GOVVV_PKG=${{ github.repository_owner }}/${{ github.event.repository.name }}
|
||||
# }}
|
||||
|
||||
- name: debug
|
||||
run: |
|
||||
ls -al
|
||||
ls -al deps/
|
||||
|
||||
- name: get release version
|
||||
id: release-version
|
||||
run: |
|
||||
echo "$GITHUB_REF_NAME" | sed 's|^[a-zA-Z]\+|RELEASE_VERSION=|' >> $GITHUB_OUTPUT
|
||||
|
||||
# create asset {{
|
||||
- name: create archives
|
||||
run: |
|
||||
zip --junk-paths ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip bin/*
|
||||
tar --create --gzip --verbose --exclude='.gitignore' --file=${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz --directory=bin/ .
|
||||
- name: create package deb
|
||||
uses: bpicode/github-action-fpm@master
|
||||
with:
|
||||
fpm_opts: "--debug --name ${{ github.event.repository.name }} --output-type deb --version ${{ steps.release-version.outputs.RELEASE_VERSION }} --architecture ${{ matrix.arch }} --exclude '*/.gitignore' --exclude '*/.git' --input-type dir"
|
||||
fpm_args: "./bin"
|
||||
- name: create package rpm
|
||||
uses: bpicode/github-action-fpm@master
|
||||
with:
|
||||
fpm_opts: "--debug --name ${{ github.event.repository.name }} --output-type rpm --version ${{ steps.release-version.outputs.RELEASE_VERSION }} --architecture ${{ matrix.rpm_arch }} --exclude '*/.gitignore' --exclude '*/.git' --input-type dir"
|
||||
fpm_args: "./bin"
|
||||
# }}
|
||||
|
||||
- name: debug
|
||||
run: |
|
||||
ls -al ./
|
||||
|
||||
# upload-release-asset {{
|
||||
- name: upload-release-asset zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: ./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip
|
||||
asset_name: ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: upload-release-asset tgz
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: ./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz
|
||||
asset_name: ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
- name: upload-release-asset deb
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: ./${{ github.event.repository.name }}_${{ steps.release-version.outputs.RELEASE_VERSION }}_${{ matrix.arch }}.deb
|
||||
asset_name: ${{ github.event.repository.name }}_${{ steps.release-version.outputs.RELEASE_VERSION }}_${{ matrix.arch }}.deb
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
- name: upload-release-asset rpm
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: ./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}-1.${{ matrix.rpm_arch }}.rpm
|
||||
asset_name: ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}-1.${{ matrix.rpm_arch }}.rpm
|
||||
asset_content_type: application/octet-stream
|
||||
# }}
|
||||
Reference in New Issue
Block a user