Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from JM-Lemmi/build/versioning
Dynamically get Version for compilation
- Loading branch information
Showing
10 changed files
with
109 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /bin/bash | ||
DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" | ||
cd "$DIR" || exit 1 | ||
|
||
if [[ $(git tag -l --contains HEAD) ]]; then | ||
echo -n $(git tag -l --contains HEAD) > ../../cmd/ical-relay/VERSION | ||
else | ||
echo -n $(git rev-parse --short HEAD) > ../../cmd/ical-relay/VERSION | ||
fi | ||
if ! git diff --quiet; then | ||
echo -n "-dirty" >> ../../cmd/ical-relay/VERSION | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Compile | ||
|
||
# Run workflow on tags starting with v (eg. v2, v1.2.0) | ||
on: | ||
push: | ||
|
||
jobs: | ||
Compile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.18.0' # The Go version to download (if necessary) and use. | ||
- run: go generate cmd/ical-relay/main.go | ||
- run: go build -o ./bin/ical-relay ./cmd/ical-relay/ | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ical-relay | ||
path: ./bin/ical-relay | ||
|
||
Package-Docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: ./cmd/ical-relay/Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/arm | ||
push: false # Will only build if this is not here |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ notifystore/ | |
postgres-data | ||
__debug_bin* | ||
cmd/ical-relay/db/* | ||
.vscode/* | ||
.vscode/* | ||
VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters