docs: update README.md #13
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: Continuous Delivery | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
BUILD_RELEASE_OUTPUT: sr65-app | |
GO_VERSION: '1.20' | |
ZENITY_VERSION: 'v0.10.12' | |
jobs: | |
prepare_release: | |
name: Prepare Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ github.ref_name }} | |
generate_release_notes: true | |
draft: true | |
build_zenity: | |
name: Build Zenity | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
arch: [amd64, arm64] | |
include: | |
- os: ubuntu-latest | |
artifact_os: linux | |
- os: macos-latest | |
artifact_os: darwin | |
- os: windows-latest | |
artifact_os: windows | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ncruces/zenity | |
ref: ${{ env.ZENITY_VERSION }} | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Build | |
shell: bash | |
working-directory: ./cmd/zenity | |
run: | | |
go generate ../../... | |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
printf '#!/bin/sh\nexec zenity.exe --unixeol --cygpath "$@"' > zenity | |
fi | |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -tags dev | |
else | |
GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath | |
fi | |
mkdir -p outputs | |
mv zenity* outputs | |
- name: Upload binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: zenity_${{ matrix.artifact_os }}_${{ matrix.arch }} | |
path: ./cmd/zenity/outputs | |
if-no-files-found: error | |
retention-days: 1 | |
build_release: | |
name: Build Release | |
needs: [prepare_release,build_zenity] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
arch: [amd64, arm64] | |
include: | |
- os: ubuntu-latest | |
release_tag_os: linux | |
ffmpeg_version: '6.0.1' | |
- os: macos-latest | |
release_tag_os: darwin | |
ffmpeg_version: '6.1.1' | |
- os: windows-latest | |
release_tag_os: windows | |
ffmpeg_version: '6.1.1' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up FFMPEG | |
uses: FedericoCarboni/setup-ffmpeg@v3 | |
id: setup-ffmpeg | |
with: | |
ffmpeg-version: ${{ matrix.ffmpeg_version }} | |
architecture: ${{ matrix.arch == 'amd64' && 'x64' || matrix.arch }} | |
github-token: ${{ github.server_url == 'https://github.com' && github.token || '' }} | |
if: ${{ !(matrix.os == 'windows-latest' && matrix.arch == 'arm64') && !(matrix.os == 'macos-latest' && matrix.arch == 'arm64') }} | |
- name: Embedding FFMPEG binary | |
run: cp ${{ steps.setup-ffmpeg.outputs.ffmpeg-path }}/ffmpeg* embed/bin | |
if: ${{ !(matrix.os == 'windows-latest' && matrix.arch == 'arm64') && !(matrix.os == 'macos-latest' && matrix.arch == 'arm64') }} | |
- name: Embedding Zenity binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: zenity_${{ matrix.release_os }}_${{ matrix.arch }} | |
path: embed/bin | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Build | |
shell: bash | |
run: GOARCH=${{ matrix.arch }} go build | |
- name: Archive | |
id: archive | |
shell: bash | |
run: | | |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
OUTPUT=${{ env.BUILD_RELEASE_OUTPUT }}_${{ matrix.release_tag_os }}_${{ matrix.arch }}.zip | |
7z a $OUTPUT ${{ env.BUILD_RELEASE_OUTPUT }}.exe | |
else | |
OUTPUT=${{ env.BUILD_RELEASE_OUTPUT }}_${{ matrix.release_tag_os }}_${{ matrix.arch }}.tar.gz | |
tar -czvf $OUTPUT ${{ env.BUILD_RELEASE_OUTPUT }} | |
fi | |
echo "output=$OUTPUT" >> "$GITHUB_OUTPUT" | |
- name: Upload Release Asset | |
run: gh release upload ${{ github.ref_name }} ${{ steps.archive.outputs.output }} | |
env: | |
GH_TOKEN: ${{ secrets.github_token }} | |
publish_release: | |
name: Publish Release | |
needs: [prepare_release,build_release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Publish Release | |
run: gh release edit ${{ github.ref_name }} --draft=false | |
env: | |
GH_TOKEN: ${{ secrets.github_token }} |