Skip to content

Commit

Permalink
feat: revamp CI and package versioning, update deps
Browse files Browse the repository at this point in the history
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
  • Loading branch information
kbdharun committed Jul 22, 2024
1 parent f8bd0a6 commit 834b7c8
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 120 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
go-version: 1.22

- name: Install build dependencies
run: |
apt-get update
apt-get install -y pkg-config build-essential
- name: Build
run: go build -o apx
run: go build -o apx -ldflags="-X 'main.Version=${{ github.sha }}'"

- name: Check for missing strings
uses: vanilla-os/missing-strings-golang-action@v0.1.0
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/goreleaser.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build-artifacts:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Install Build Dependencies
run: |
apt-get update
apt-get install -y pkg-config build-essential
- name: Build
run: go build -o apx -ldflags="-X 'main.Version=${{ github.ref_name }}'"

- name: Compress Package
run: tar -czvf apx.tar.gz apx

- name: Compress Manpage
run: tar -czvf apx-man.tar.gz man/man1/apx.1

- name: Calculate and Save Checksums
run: |
sha256sum apx.tar.gz >> checksums.txt
sha256sum apx-man.tar.gz >> checksums.txt
- uses: actions/upload-artifact@v4
with:
name: apx
path: |
apx.tar.gz
apx-man.tar.gz
checksums.txt
release:
runs-on: ubuntu-latest
needs: build-artifacts
permissions:
contents: write # to create and upload assets to releases
attestations: write # to upload assets attestation for build provenance
id-token: write # grant additional permission to attestation action to mint the OIDC token permission

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: apx

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" --generate-notes *.tar.gz checksums.txt

- name: Attest Release Files
id: attest
uses: actions/attest-build-provenance@v1
with:
subject-path: '*.tar.gz, checksums.txt'
48 changes: 0 additions & 48 deletions .goreleaser.yaml

This file was deleted.

1 change: 0 additions & 1 deletion VERSION

This file was deleted.

4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/vanilla-os/apx/v2

go 1.21

toolchain go1.21.6
go 1.22

require (
github.com/google/uuid v1.6.0
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/vanilla-os/orchid v0.5.0 h1:QAOjJ2VcyND5TxK0XYUEu+dysxXicRHhV6i/07S47mk=
github.com/vanilla-os/orchid v0.5.0/go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao=
github.com/vanilla-os/orchid v0.5.1-0.20240617142635-ba1500bd478e h1:j2FjlVF0DrzGO/zVXteqCuuz+YuYii2ksNUFM2x6PkA=
github.com/vanilla-os/orchid v0.5.1-0.20240617142635-ba1500bd478e/go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao=
github.com/vanilla-os/orchid v0.6.0 h1:aH7i621QrqtbspGUie4To28zCk1u1UvGHGzL11wdldE=
github.com/vanilla-os/orchid v0.6.0/go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/vanilla-os/orchid/cmdr"
)

var Version = "2.4.1"
var Version = "development"

//go:embed locales/*.yml
var fs embed.FS
Expand Down

0 comments on commit 834b7c8

Please sign in to comment.