Skip to content

feat: add support for uniq #990

feat: add support for uniq

feat: add support for uniq #990

name: build-and-test
on:
push:
branches: [master]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
jobs:
setup-environment:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v2.1.4
with:
go-version: '1.22'
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
uses: actions/cache@v2
with:
path: |
/home/runner/go/pkg/mod
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Cache Tools
id: tool-cache
uses: actions/cache@v2
with:
path: /home/runner/go/bin
key: v1-tools-${{ runner.os }}-${{ hashFiles('./pkg/internal/tools/go.mod') }}
- name: Install dependencies
if: steps.module-cache.outputs.hit != 'true'
run: make gomoddownload
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools
build-vue:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Setup pnpm
uses: pnpm/action-setup@v2.1.0
with:
version: '8.x.x'
- name: Compile Vue
run: make uptrace-vue
- name: Upload Vue Dist
uses: actions/upload-artifact@v2
with:
name: uptrace-vue
path: ./vue/dist/*
cross-compile:
runs-on: ubuntu-latest
needs: [build-vue]
strategy:
matrix:
binary:
- darwin_amd64
- darwin_arm64
- linux_amd64
- linux_arm64
- windows_amd64
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Go
uses: actions/setup-go@v2.1.4
with:
go-version: '1.22'
- name: Cache Go
id: module-cache
uses: actions/cache@v2
with:
path: |
/home/runner/go/pkg/mod
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Download Vue Dist
uses: actions/download-artifact@v2
with:
name: uptrace-vue
path: ./vue/dist/
- name: Build Binaries for ${{ matrix.binary }}
run: make uptrace-${{ matrix.binary }}
- name: Upload Binaries
uses: actions/upload-artifact@v2
with:
name: uptrace-binaries
path: ./bin/*
build-package:
runs-on: ubuntu-latest
needs: [cross-compile]
strategy:
fail-fast: false
matrix:
package_type: ['deb', 'rpm']
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Install fpm
run: gem install --no-document fpm -v 1.15.1
- name: Download Binaries
uses: actions/download-artifact@v2
with:
name: uptrace-binaries
path: bin/
- run: chmod +x bin/*
- name: Set Release Tag
id: github_tag
run: ./.github/workflows/scripts/set_release_tag.sh
- name: Build ${{ matrix.package_type }} amd64 package
run:
./internal/packaging/fpm/${{ matrix.package_type }}/build.sh "${{
steps.github_tag.outputs.tag }}" "amd64" "./dist/"
- name: Build ${{ matrix.package_type }} arm64 package
run:
./internal/packaging/fpm/${{ matrix.package_type }}/build.sh "${{
steps.github_tag.outputs.tag }}" "arm64" "./dist/"
- name: Upload Packages
uses: actions/upload-artifact@v2
with:
name: uptrace-packages
path: ./dist/*
publish-dev:
runs-on: ubuntu-latest
needs: [cross-compile]
if:
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) &&
github.repository == 'uptrace/uptrace'
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v1
- name: Download Binaries
uses: actions/download-artifact@v2
with:
name: uptrace-binaries
path: ./bin/
- name: Add Permissions to binaries
run: chmod -R +x ./bin
- name: Set docker tag
run: echo "DOCKER_TAG=${GITHUB_SHA}" >> $GITHUB_ENV
- name: Login to Docker hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: DOCKER_IMAGE=uptrace-dev make docker-uptrace
publish-stable:
runs-on: ubuntu-latest
needs: [build-package]
if: (startsWith(github.ref, 'refs/tags/v')) && github.repository == 'uptrace/uptrace'
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v1
- name: Setup Go
uses: actions/setup-go@v2.1.4
with:
go-version: '1.22'
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
mkdir bin/
- name: Cache Tools
id: tool-cache
uses: actions/cache@v2
with:
path: /home/runner/go/bin
key: v1-tools-${{ runner.os }}-${{ hashFiles('./pkg/internal/tools/go.mod') }}
- name: Download Binaries
uses: actions/download-artifact@v2
with:
name: uptrace-binaries
path: ./bin/
- name: Add Permissions to binaries
run: chmod -R +x ./bin
- name: Download Packages
uses: actions/download-artifact@v2
with:
name: uptrace-packages
path: ./dist/
- name: Add Permissions to packages
run: chmod -R +x ./dist
- name: Verify Distribution Files Exist
id: check
run: ./.github/workflows/scripts/verify-dist-files-exist.sh
- name: Set Release Tag
id: github_tag
run: ./.github/workflows/scripts/set_release_tag.sh
- name: Set Docker Tag
run: echo "DOCKER_TAG=${RELEASE_TAG:1}" >> $GITHUB_ENV
env:
RELEASE_TAG: ${{ steps.github_tag.outputs.tag }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: DOCKER_IMAGE=uptrace make docker-uptrace
- name: Create Github Release
if: steps.check.outputs.passed == 'true'
run: |
cp bin/* dist/
cd bin && shasum -a 256 * > checksums.txt && cd ../
ghr -b '[CHANGELOG](https://github.com/uptrace/uptrace/blob/master/CHANGELOG.md)' -t $GITHUB_TOKEN -u uptrace -r uptrace --replace $RELEASE_TAG dist/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ steps.github_tag.outputs.tag }}