Remove new line from version string #32
Workflow file for this run
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
name: "Build and release" | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Linux deps | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential pkg-config libpcsclite-dev libgl1-mesa-dev xorg-dev | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "stable" | |
- name: Install Fyne | |
run: go install fyne.io/fyne/v2/cmd/fyne@latest | |
- name: Test | |
run: go test ./... | |
buildLinux: | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Linux deps | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential pkg-config libpcsclite-dev libgl1-mesa-dev xorg-dev | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "stable" | |
- name: Install Fyne | |
run: go install fyne.io/fyne/v2/cmd/fyne@latest | |
- name: Generate version file | |
run: | | |
VERSION=$(git describe --tags --abbrev=0 | tail -c +2) | |
echo "$VERSION" >> assets/version | |
echo " Version = \"$VERSION\"" >> FyneApp.toml | |
- name: Build GUI version | |
run: | | |
fyne package -os linux | |
mv 'Bas Celik.tar.xz' bas-celik.linux.amd64.tar.xz | |
- name: Upload GUI version | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-build-artifact | |
path: bas-celik.linux.amd64.tar.xz | |
- name: Build CLI version | |
run: | | |
echo -n "cli" >> assets/version | |
rm -R embed/translation | |
go build -tags "cli" -ldflags "-s -w" . | |
mv bas-celik bas-celik-cli.linux.amd64 | |
- name: Upload CLI version | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-cli-build-artifact | |
path: bas-celik-cli.linux.amd64 | |
buildWindows: | |
runs-on: windows-latest | |
needs: [test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "stable" | |
- name: Install Fyne | |
run: go install fyne.io/fyne/v2/cmd/fyne@latest | |
- name: Generate version file | |
run: | | |
$version = (git describe --tags --abbrev=0).Substring(1) | |
$version | Out-File -FilePath "assets/version" -Append | |
" Version = `"$version`"" | Out-File -FilePath "FyneApp.toml" -Append | |
- name: Build | |
run: | | |
fyne package -os windows | |
mv 'Bas Celik.exe' bas-celik.windows.amd64.exe | |
- name: Upload executables | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-build-artifact | |
path: bas-celik.windows.amd64.exe | |
release: | |
runs-on: ubuntu-latest | |
needs: [buildLinux, buildWindows] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Move files | |
run: | | |
mv linux-build-artifact/* . | |
mv linux-cli-build-artifact/* . | |
mv windows-build-artifact/* . | |
- name: Generate release body | |
run: | | |
touch changelog.md | |
git tag -l --format='%(contents)' ${{github.ref_name}} >> changelog.md | |
echo '' >> changelog.md | |
echo '```' >> changelog.md | |
sha256sum bas-celik.linux.amd64.tar.xz >> changelog.md | |
echo '```' >> changelog.md | |
echo '' >> changelog.md | |
echo '```' >> changelog.md | |
sha256sum bas-celik-cli.linux.amd64 >> changelog.md | |
echo '```' >> changelog.md | |
echo '' >> changelog.md | |
echo '```' >> changelog.md | |
sha256sum bas-celik.windows.amd64.exe >> changelog.md | |
echo '```' >> changelog.md | |
echo '' >> changelog.md | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
bas-celik.linux.amd64.tar.xz | |
bas-celik-cli.linux.amd64 | |
bas-celik.windows.amd64.exe | |
body_path: changelog.md | |
tag_name: ${{github.ref_name}} |