Skip to content

Fix in the release workflow #2

Fix in the release workflow

Fix in the release workflow #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
BUILD_TMP: ./build-tmp
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout kanto
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout suite-connector
uses: actions/checkout@v2
with:
repository: eclipse-kanto/suite-connector
path: ${{ env.BUILD_TMP }}/suite-connector
ref: ${{ github.ref }}
persist-credentials: false
- name: Checkout container-management
uses: actions/checkout@v2
with:
repository: eclipse-kanto/container-management
path: ${{ env.BUILD_TMP }}/container-management
ref: ${{ github.ref }}
- name: Checkout file-upload
uses: actions/checkout@v2
with:
repository: eclipse-kanto/file-upload
path: ${{ env.BUILD_TMP }}/file-upload
ref: ${{ github.ref }}
- name: Checkout software-update
uses: actions/checkout@v2
with:
repository: eclipse-kanto/software-update
path: ${{ env.BUILD_TMP }}/software-update
ref: ${{ github.ref }}
- name: Checkout local-digital-twins
uses: actions/checkout@v2
with:
repository: eclipse-kanto/local-digital-twins
path: ${{ env.BUILD_TMP }}/local-digital-twins
ref: ${{ github.ref }}
- name: Checkout file-backup
uses: actions/checkout@v2
with:
repository: eclipse-kanto/file-backup
path: ${{ env.BUILD_TMP }}/file-backup
ref: ${{ github.ref }}
- name: Checkout system-metrics
uses: actions/checkout@v2
with:
repository: eclipse-kanto/system-metrics
path: ${{ env.BUILD_TMP }}/system-metrics
ref: ${{ github.ref }}
- name: Checkout update-manager
uses: actions/checkout@v2
with:
repository: eclipse-kanto/update-manager
path: ${{ env.BUILD_TMP }}/update-manager
ref: ${{ github.ref }}
- name: Checkout azure-connector
uses: actions/checkout@v2
with:
repository: eclipse-kanto/azure-connector
path: ${{ env.BUILD_TMP }}/azure-connector
ref: ${{ github.ref }}
- name: Checkout aws-connector
uses: actions/checkout@v2
with:
repository: eclipse-kanto/aws-connector
path: ${{ env.BUILD_TMP }}/aws-connector
ref: ${{ github.ref }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21.0
- name: Generate suite-connector Coverage
working-directory: ${{ env.BUILD_TMP }}/suite-connector
run: |
docker system prune -f
docker-compose -f ./docker/docker-compose-tests.yml up --build --no-color tests
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
docker-compose -f ./docker/docker-compose-tests.yml down
- name: Generate container-management Coverage
working-directory: ${{ env.BUILD_TMP }}/container-management
run: |
go test ./... -v -coverprofile coverage.out
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate file-upload Coverage
working-directory: ${{ env.BUILD_TMP }}/file-upload
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate software-update Coverage
working-directory: ${{ env.BUILD_TMP }}/software-update
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate local-digital-twins Coverage
working-directory: ${{ env.BUILD_TMP }}/local-digital-twins
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate file-backup Coverage
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
working-directory: ${{ env.BUILD_TMP }}/file-backup
- name: Generate system-metrics Coverage
working-directory: ${{ env.BUILD_TMP }}/system-metrics
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate update-manager Coverage
working-directory: ${{ env.BUILD_TMP }}/update-manager
run: |
go test -v -race ./... -coverprofile coverage.out -covermode atomic
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate azure-connector Coverage
working-directory: ${{ env.BUILD_TMP }}/azure-connector
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Generate aws-connector Coverage
working-directory: ${{ env.BUILD_TMP }}/aws-connector
run: |
go test ./... -v -coverprofile coverage.out -tags=unit
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: ~>1.22
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GOPATH is no longer exported by the actions/setup-go@v2
# https://github.com/actions/setup-go/issues/12#issuecomment-604605595
# https://github.com/goreleaser/goreleaser-action/issues/267
GOPATH: /home/runner/go