Format message to include info about the issue(s) when unhealthy #453
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: Release naisdevice | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-22.04", "macOS-latest"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- id: tool_versions | |
run: echo "go=$(grep golang .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.tool_versions.outputs.go }} | |
- if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes build-essential | |
- run: "make test" | |
- run: "make check" | |
- run: "go vet ./..." | |
set-version: | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.set-version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set version | |
id: set-version | |
run: echo "version=${GITHUB_REF#refs/*/}" >> ${GITHUB_OUTPUT} | |
build-windows: | |
needs: | |
- set-version | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- gotags: "" | |
output-suffix: "" | |
- gotags: "tenant" | |
output-suffix: "-tenant" | |
steps: | |
- uses: actions/checkout@v4 | |
- id: tool_versions | |
run: echo "go=$(grep golang .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.tool_versions.outputs.go }} | |
- name: build binaries and installer | |
env: | |
MSI_SIGN_CERT: "${{ secrets.MSI_SIGN_CERT }}" | |
MSI_SIGN_KEY: "${{ secrets.MSI_SIGN_KEY }}" | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes nsis osslsigncode | |
echo "${MSI_SIGN_CERT}" > packaging/windows/naisdevice.crt | |
echo "${MSI_SIGN_KEY}" > packaging/windows/naisdevice.key | |
make nsis GOTAGS=${{ matrix.gotags }} VERSION=${{ needs.set-version.outputs.version }} | |
md5sum bin/windows-client/* | |
md5sum packaging/windows/naisdevice.exe | |
- name: upload windows-client | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-client${{ matrix.output-suffix }} | |
path: bin/windows-client | |
if-no-files-found: error | |
- name: upload windows-installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-installer${{ matrix.output-suffix }} | |
path: packaging/windows/naisdevice.exe | |
if-no-files-found: error | |
build-macos: | |
strategy: | |
matrix: | |
include: | |
- gotags: "" | |
output-suffix: "" | |
- gotags: "tenant" | |
output-suffix: "-tenant" | |
needs: | |
- set-version | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- id: tool_versions | |
run: echo "go=$(grep golang .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.tool_versions.outputs.go }} | |
- name: Import Code-Signing Certificates | |
uses: Apple-Actions/import-codesign-certs@v2 | |
with: | |
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} | |
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} | |
- name: build pkg | |
env: | |
APPLE_NOTARIZE_AUTH_KEY_P8_BASE64: "${{ secrets.APPLE_NOTARIZE_AUTH_KEY_P8_BASE64 }}" | |
APPLE_NOTARIZE_D: "${{ secrets.APPLE_NOTARIZE_D }}" | |
APPLE_NOTARIZE_I: "${{ secrets.APPLE_NOTARIZE_I }}" | |
run: | | |
brew install imagemagick | |
make pkg GOTAGS=${{ matrix.gotags }} VERSION=${{ needs.set-version.outputs.version }} RELEASE=${{ startsWith(github.ref, 'refs/tags/') && 'true' || 'false' }} | |
md5 bin/macos-client/* | |
md5 naisdevice.pkg | |
- name: upload pkg | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pkg${{ matrix.output-suffix }} | |
path: naisdevice.pkg | |
if-no-files-found: error | |
build-linux: | |
strategy: | |
matrix: | |
include: | |
- gotags: "" | |
output-suffix: "" | |
- gotags: "tenant" | |
output-suffix: "-tenant" | |
needs: | |
- set-version | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- id: tool_versions | |
run: echo "go=$(grep golang .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.tool_versions.outputs.go }} | |
- name: create debian package | |
env: | |
SUFFIX: "${{ matrix.output-suffix }}" | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes build-essential ruby ruby-dev rubygems | |
sudo gem install --no-document fpm -v 1.15.1 | |
make deb GOTAGS=${{ matrix.gotags }} VERSION=${{ needs.set-version.outputs.version }} | |
md5sum naisdevice*.deb | |
- name: upload debian package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: deb${{ matrix.output-suffix }} | |
path: naisdevice*.deb | |
if-no-files-found: error | |
new_release: | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
contents: write | |
needs: | |
- set-version | |
- test | |
- build-macos | |
- build-windows | |
- build-linux | |
runs-on: ubuntu-22.04 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: create release | |
id: create_release | |
uses: softprops/[email protected] | |
with: | |
tag_name: ${{ needs.set-version.outputs.version }} | |
release_name: Release ${{ needs.set-version.outputs.version }} | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
strategy: | |
matrix: | |
output-suffix: ["", "-tenant"] | |
needs: | |
- set-version | |
- test | |
- build-macos | |
- build-windows | |
- build-linux | |
- new_release | |
runs-on: ubuntu-22.04 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: download windows installer | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-installer${{ matrix.output-suffix }} | |
- name: Calculate checksum | |
run: | | |
sha256sum naisdevice.exe | awk {'print $1}' > naisdevice.exe.sha256 | |
- name: upload naisdevice.exe | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ needs.new_release.outputs.upload_url }} | |
asset_path: ./naisdevice.exe | |
asset_name: naisdevice${{ matrix.output-suffix }}.exe | |
asset_content_type: application/octet-stream | |
- name: upload naisdevice.exe.sha256 | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ needs.new_release.outputs.upload_url }} | |
asset_path: ./naisdevice.exe.sha256 | |
asset_name: naisdevice${{ matrix.output-suffix }}.exe.sha256 | |
asset_content_type: text/plain | |
- name: download pkg | |
uses: actions/download-artifact@v3 | |
with: | |
name: pkg${{ matrix.output-suffix }} | |
- name: Calculate checksum | |
run: | | |
sha256sum naisdevice.pkg | awk {'print $1}' > naisdevice.pkg.sha256 | |
- name: upload macos pkg to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ needs.new_release.outputs.upload_url }} | |
asset_path: ./naisdevice.pkg | |
asset_name: naisdevice${{ matrix.output-suffix }}.pkg | |
asset_content_type: application/octet-stream | |
- name: upload macos pkg checksum to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ needs.new_release.outputs.upload_url }} | |
asset_path: ./naisdevice.pkg.sha256 | |
asset_name: naisdevice${{ matrix.output-suffix }}.pkg.sha256 | |
asset_content_type: text/plain | |
- name: download deb | |
uses: actions/download-artifact@v3 | |
with: | |
name: deb${{ matrix.output-suffix }} | |
- name: upload debian package to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ needs.new_release.outputs.upload_url }} | |
asset_path: ./naisdevice${{ matrix.output-suffix }}_${{ needs.set-version.outputs.version }}_amd64.deb | |
asset_name: naisdevice${{ matrix.output-suffix }}.deb | |
asset_content_type: application/octet-stream |