Skip to content

Commit

Permalink
Nightly build fix
Browse files Browse the repository at this point in the history
APT packaging fixes

- Adopt nightly versioning to be parsed
- Fix binary source path for release builds

Improve unstable build versioning

Use timestamp as bugfix version, as we would have the same version number in all builds until the version tag gets updated
  • Loading branch information
DerAndereAndi committed Dec 4, 2021
1 parent acae4a2 commit 79d6388
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release -f .goreleaser-nightly.yml --rm-dist
args: --snapshot -f .goreleaser-nightly.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish .deb to Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
for filename in dist/*.deb; do
for filename in release/*.deb; do
echo "Pushing $filename to 'unstable'"
cloudsmith push deb evcc/unstable/any-distro/any-version $filename
done
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
for filename in dist/*.deb; do
for filename in release/*.deb; do
echo "Pushing $filename to 'stable'"
cloudsmith push deb evcc/stable/any-distro/any-version $filename
done
8 changes: 4 additions & 4 deletions .goreleaser-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ builds:
flags:
- -tags=release
ldflags:
- -X github.com/evcc-io/evcc/server.Version={{.Version}}.0-nightly.{{.Date}} -X github.com/evcc-io/evcc/server.Commit={{.ShortCommit}} -s -w
- -X github.com/evcc-io/evcc/server.Version={{.Version}}.{{.Timestamp}} -X github.com/evcc-io/evcc/server.Commit={{.ShortCommit}} -s -w
env:
- CGO_ENABLED=0
goos:
Expand All @@ -31,15 +31,15 @@ archives:
format: zip
files:
- evcc.dist.yaml
name_template: "{{.ProjectName}}_{{ .Version }}.0-nightly.{{.Date}}_{{.Os}}-{{.Arch}}"
name_template: "{{.ProjectName}}_{{ .Version }}.{{.Timestamp}}_{{.Os}}-{{.Arch}}"
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "nightly"
name_template: "{{ .Version }}.{{.Timestamp}}"
nfpms:
- id: default
package_name: evcc
file_name_template: "{{.ProjectName}}_{{ .Version }}.0-nightly.{{.Date}}_{{.Os}}-{{.Arch}}"
file_name_template: "{{.ProjectName}}_{{ .Version }}.{{.Timestamp}}_{{.Os}}-{{.Arch}}"

homepage: https://evcc.io
description: EV Charge Controller
Expand Down
2 changes: 2 additions & 0 deletions packaging/scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-decon
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
deb-systemd-invoke try-restart evcc.service >/dev/null || true
else
deb-systemd-invoke start evcc.service >/dev/null || true
fi
fi
fi

0 comments on commit 79d6388

Please sign in to comment.