Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gha build release #25

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 78 additions & 75 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Orb Agent - release
on:
workflow_dispatch:
pull_request:
branches:
- develop
push:
branches: [ release ]
paths:
Expand Down Expand Up @@ -123,7 +126,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
if: needs.get-next-version.outputs.new-release-published == 'true'
#if: needs.get-next-version.outputs.new-release-published == 'true'
env:
BUILD_VERSION: ${{ needs.get-next-version.outputs.new-release-version }}
BUILD_COMMIT: ${{ needs.get-next-version.outputs.short-sha }}
Expand Down Expand Up @@ -153,84 +156,84 @@ jobs:
with:
context: .
file: agent/docker/Dockerfile
platforms: linux/amd64, linux/arm64
push: true
platforms: linux/arm64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
netboxlabs/${{ env.APP_NAME }}:latest
netboxlabs/${{ env.APP_NAME }}:${{ env.BUILD_VERSION }}
netboxlabs/${{ env.APP_NAME }}:1.0.0
build-args: |
GO_VERSION=${{ env.GO_VERSION }}

semantic-release:
name: Semantic release
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Write package.json
uses: DamianReeves/write-file-action@master
with:
path: ./package.json
write-mode: overwrite
contents: |
{
"name": "${{ env.APP_NAME }}",
"version": "1.0.0",
"devDependencies": {
"semantic-release-export-data": "^1.0.1",
"@semantic-release/changelog": "^6.0.3"
}
}
- name: Write .releaserc.json
uses: DamianReeves/write-file-action@master
with:
path: ./.releaserc.json
write-mode: overwrite
contents: |
{
"branches": "release",
"repositoryUrl": "https://github.com/netboxlabs/orb-agent",
"debug": "true",
"tagFormat": "/v${version}",
"plugins": [
["semantic-release-export-data"],
["@semantic-release/commit-analyzer", {
"releaseRules": [
{ "message": "*", "release": "patch"},
{ "message": "fix*", "release": "patch" },
{ "message": "feat*", "release": "minor" },
{ "message": "perf*", "release": "major" }
]
}],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Semantic Versioning Changelog"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "release/**"
}
]
}
]
]
}
- name: setup semantic-release
run: npm i
- name: Release
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}
run: npx semantic-release --debug
# semantic-release:
# name: Semantic release
# needs: build
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: "lts/*"
# - name: Write package.json
# uses: DamianReeves/write-file-action@master
# with:
# path: ./package.json
# write-mode: overwrite
# contents: |
# {
# "name": "${{ env.APP_NAME }}",
# "version": "1.0.0",
# "devDependencies": {
# "semantic-release-export-data": "^1.0.1",
# "@semantic-release/changelog": "^6.0.3"
# }
# }
# - name: Write .releaserc.json
# uses: DamianReeves/write-file-action@master
# with:
# path: ./.releaserc.json
# write-mode: overwrite
# contents: |
# {
# "branches": "release",
# "repositoryUrl": "https://github.com/netboxlabs/orb-agent",
# "debug": "true",
# "tagFormat": "/v${version}",
# "plugins": [
# ["semantic-release-export-data"],
# ["@semantic-release/commit-analyzer", {
# "releaseRules": [
# { "message": "*", "release": "patch"},
# { "message": "fix*", "release": "patch" },
# { "message": "feat*", "release": "minor" },
# { "message": "perf*", "release": "major" }
# ]
# }],
# "@semantic-release/release-notes-generator",
# [
# "@semantic-release/changelog",
# {
# "changelogFile": "CHANGELOG.md",
# "changelogTitle": "# Semantic Versioning Changelog"
# }
# ],
# [
# "@semantic-release/github",
# {
# "assets": [
# {
# "path": "release/**"
# }
# ]
# }
# ]
# ]
# }
# - name: setup semantic-release
# run: npm i
# - name: Release
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}
# run: npx semantic-release --debug
4 changes: 2 additions & 2 deletions agent/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ ARG OTEL_TAG=0.111.0
ARG NETWORK_DISCOVERY_TAG=latest
ARG GO_VERSION=1.23

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS builder
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder

RUN apt-get update && apt-get install --yes git make
RUN apk update && apk add --no-cache build-base make git

WORKDIR /src/orb-agent

Expand Down
Loading