Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
changesDir: changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## [{{ .Version }}](https://github.com/skyoo2003/devcloud/releases/tag/{{ .Version }}) - {{ .Time.Format "2006-01-02" }}'


kindFormat: "### {{ .Kind }}"
changeFormat: "* {{ .Body }} ([#{{ .Custom.Issue }}](https://github.com/skyoo2003/devcloud/issues/{{ .Custom.Issue }}))"
kinds:
- label: Added
- label: Changed
- label: Deprecated
- label: Removed
- label: Fixed
- label: Security
- label: Documentation
custom:
- key: Issue
label: Issue Number
type: int
minInt: 1
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
attestations: write
steps:
- name: Checkout the code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@41dfa10bef8ca8f7c4c7cec63b269ccb8a9156b9 # v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Verify changie release notes exist
run: |
if [ ! -f "changes/${{ github.ref_name }}.md" ]; then
echo "::error::Changie fragment changes/${{ github.ref_name }}.md not found."
echo "::error::Run 'changie batch ${{ github.ref_name }}' and 'changie merge' before pushing the tag."
exit 1
fi
- name: Execute GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # goreleaser-action v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --release-notes changes/${{ github.ref_name }}.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@5d5df5e032fcb57d3c9d9901e9b8f8b2b7d8051a # v7
with:
name: devcloud
path: dist/*
67 changes: 67 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 2

project_name: devcloud

env:
- GO111MODULE=on
- CGO_ENABLED=0

before:
hooks:
- go mod download

builds:
- id: devcloud
binary: devcloud
main: cmd/devcloud/main.go
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64

archives:
- id: devcloud
format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
- CHANGELOG.md

changelog:
disable: false

checksum:
algorithm: sha256
name_template: 'CHECKSUMS'

dockers_v2:
- images:
- ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/{{ .ProjectName }}
dockerfile: Dockerfile.goreleaser
ids:
- devcloud
sbom: false
flags:
- "--provenance=false"
tags:
- "{{ .Tag }}-alpine"
- "v{{ .Major }}.{{ .Minor }}-alpine"
- "v{{ .Major }}-alpine"
- "latest-alpine"
labels:
org.opencontainers.image.created: "{{ .Date }}"
org.opencontainers.image.source: "https://github.com/{{ .Env.GITHUB_REPOSITORY_OWNER }}/{{ .ProjectName }}"
org.opencontainers.image.title: "{{ .ProjectName }}"
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: "{{ .Version }}"

release:
name_template: "{{ .Version }}"
disable: false
mode: replace
11 changes: 11 additions & 0 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM --platform=$BUILDPLATFORM alpine:3.21

RUN adduser --system --home /devcloud appuser
VOLUME /devcloud
WORKDIR /devcloud
ARG TARGETOS
ARG TARGETARCH
COPY ${TARGETOS}/${TARGETARCH}/devcloud /usr/bin/devcloud

USER appuser
ENTRYPOINT ["devcloud"]
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build test codegen run clean test-compat build-web build-all docker-build docker-run
.PHONY: build test codegen run clean test-compat build-web build-all docker-build docker-run changelog

build:
go build -o dist/devcloud ./cmd/devcloud
Expand Down Expand Up @@ -32,3 +32,10 @@ docker-run:

clean:
rm -rf dist/ data/

changelog:
@if [ -z "$(VERSION)" ]; then \
echo "VERSION is required. Usage: make changelog VERSION=v0.2.0"; \
exit 1; \
fi
@changie batch $(VERSION) && changie merge
Empty file added changes/header.tpl.md
Empty file.
Loading