Skip to content

Commit

Permalink
build(release): publish the archives so they can be downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
aybabtme committed Oct 17, 2024
1 parent d6ad70f commit 84111a5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
with:
go-version: ">=1.23"
cache: true
- run: echo "${HOME}/.humanlog/bin" >> $GITHUB_PATH
- run: curl https://humanlog.dev/install_apictl.sh | bash
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean --draft --snapshot --config .goreleaser-dev.yaml
args: release --clean --draft --skip validate --config .goreleaser-dev.yaml
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
- run: echo "${HOME}/.humanlog/bin" >> $GITHUB_PATH
- run: curl https://humanlog.dev/install_apictl.sh | bash
- run: ./script/create_version_artifacts.sh
env:
CHANNEL: "dev"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Create a release

on:
workflow_dispatch:
push:
tags:
- "*"
Expand Down
10 changes: 9 additions & 1 deletion .goreleaser-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ release:
name: humanlog
target_commitish: "{{ .Commit }}"
prerelease: true
draft: true
replace_existing_draft: true
replace_existing_artifacts: true
name_template: "{{ incpatch .Version }}-next.{{ .Timestamp }}.{{ .ShortCommit }}"
header: |
## very unstable dev build of humanlog ({{ .Date }})
Do not use. For folks iterating on humanlog and wanting to test their work.
archives:
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
- name_template: "{{ .ProjectName }}_{{ incpatch .Version }}-next.{{ .Timestamp }}.{{ .ShortCommit }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
Expand Down
8 changes: 5 additions & 3 deletions script/create_version_artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail
set -euox pipefail

root=$(git rev-parse --show-toplevel)

Expand All @@ -12,7 +12,7 @@ function handle_archive() {
while read -r filename; read -r path; read -r goos; read -r goarch; do
local url=$(get_archive_url ${filename})
if [ -z "${url}" ]; then echo "no archive for ${filename}"; continue; fi
local sig=$(get_signature ${path})
local sig=$(get_signature ${root}/${path})

apictl create version-artifact \
--project ${project} \
Expand Down Expand Up @@ -50,7 +50,9 @@ function get_sha256sum() {

function get_signature() {
local filename=${1}
cat ${filename}.sig
ls -lha $(dirname ${filename})
if [ -f "${filename}" ]; then cat < ${filename}.sig;
else echo "no-signature"; fi
}

function get_version_major() {
Expand Down

0 comments on commit 84111a5

Please sign in to comment.