Release fmcsadmin 2.4.0 (#50) #300
This file contains hidden or 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 | |
| on: [ push, pull_request ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job#standard-github-hosted-runners-for-public-repositories | |
| os: [ 'ubuntu-22.04', 'ubuntu-22.04-arm', 'ubuntu-24.04', 'ubuntu-24.04-arm', 'ubuntu-latest', 'macos-14', 'macos-15-intel', 'macos-15', 'macos-26', 'macos-latest', 'windows-2022', 'windows-2025', 'windows-latest', 'windows-11-arm' ] | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: Setup Go | |
| uses: ./.github/actions/setup-go | |
| - run: go test | |
| - shell: bash | |
| run: grep "^VERSION=" < Makefile | sed -e "s/VERSION/fmcsadmin_version/g" >> "$GITHUB_ENV" | |
| - run: go build -ldflags "-X main.version=${{ env.fmcsadmin_version }}" fmcsadmin.go | |
| - if: runner.os == 'macOS' | |
| run: make dist && cp -p "dist/fmcsadmin-${{ env.fmcsadmin_version }}-macos/fmcsadmin" . | |
| - shell: bash | |
| run: echo "goss_commit_hash=5704120d25902119cb1139e04bca3db7742a9f73" >> "$GITHUB_ENV" # v0.4.9 | |
| - if: runner.os == 'macOS' || runner.os == 'Windows' | |
| shell: bash | |
| run: echo "GOSS_USE_ALPHA=1" >> "$GITHUB_ENV" | |
| - if: runner.os == 'Linux' && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo') | |
| name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GHCR_TOKEN_202605 }} | |
| - if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest') && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo') | |
| name: Pull from GitHub Container Registry | |
| run: | | |
| docker pull ghcr.io/matsuo/goss:latest | |
| docker run --rm -i -v "/$(pwd):/tmp" ghcr.io/matsuo/goss:latest bash <<'EOF' | |
| cd /root/go/src/github.com/goss-org/goss | |
| cp ./release/goss-darwin-amd64 /tmp/goss-darwin-amd64 | |
| cp ./release/goss-darwin-arm64 /tmp/goss-darwin-arm64 | |
| cp ./release/goss-linux-amd64 /tmp/goss-linux-amd64 | |
| cp ./release/goss-linux-arm64 /tmp/goss-linux-arm64 | |
| EOF | |
| - if: runner.os == 'macOS' || matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-24.04-arm' || (runner.os == 'Linux' && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo')) | |
| run: | | |
| curl -L "https://github.com/goss-org/goss/archive/${{ env.goss_commit_hash }}.tar.gz" -o goss.tar.gz | |
| tar xzvf goss.tar.gz | |
| cd "goss-${{ env.goss_commit_hash }}" | |
| make build | |
| cd .. | |
| - if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| curl -L "https://github.com/goss-org/goss/archive/${{ env.goss_commit_hash }}.tar.gz" -o goss.tar.gz | |
| tar xzvf goss.tar.gz | |
| cd "goss-${{ env.goss_commit_hash }}" | |
| go build -o goss-windows-amd64.exe github.com/goss-org/goss/cmd/goss | |
| mkdir release | |
| mv goss-windows-amd64.exe release/ | |
| cd .. | |
| - if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest') && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo') | |
| run: | | |
| ./goss-linux-amd64 --version | |
| OS=linux ./goss-linux-amd64 --gossfile tests/goss.yaml validate --format documentation | |
| - if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest') && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo') | |
| run: | | |
| OS=linux "./goss-${{ env.goss_commit_hash }}/release/goss-linux-amd64" --gossfile tests/goss.yaml validate --format documentation | |
| - if: matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-24.04-arm' | |
| run: | | |
| OS=linux "./goss-${{ env.goss_commit_hash }}/release/goss-linux-arm64" --gossfile tests/goss.yaml validate --format documentation | |
| - if: runner.os == 'macOS' | |
| run: | | |
| OS=darwin "./goss-${{ env.goss_commit_hash }}/release/goss-darwin-amd64" --gossfile tests/goss.yaml validate --format documentation | |
| - if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| OS=windows "./goss-${{ env.goss_commit_hash }}/release/goss-windows-amd64.exe" --gossfile tests/goss.yaml validate --format documentation | |
| - run: ./fmcsadmin -v | |
| - name: Create dmg format file for macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| lipo -info "dist/fmcsadmin-${{ env.fmcsadmin_version }}-macos/fmcsadmin" | |
| cd "dist/fmcsadmin-${{ env.fmcsadmin_version }}-macos" | |
| pkgbuild --root . --identifier jp.co.emic.fmcsadmin --version "${{ env.fmcsadmin_version }}" --install-location /usr/local/bin ../fmcsadmin.pkg | |
| cd .. | |
| cp -p ../{LICENSE.txt,README.md,NOTICE.txt,release-notes.txt} . | |
| cp -p ../macOS/{Distribution.xml,welcome.txt} . | |
| productbuild --distribution Distribution.xml --resources . --package-path fmcsadmin.pkg "fmcsadmin-${{ env.fmcsadmin_version }}-unsigned.pkg" | |
| cp -p "fmcsadmin-${{ env.fmcsadmin_version }}-unsigned.pkg" "fmcsadmin-${{ env.fmcsadmin_version }}.pkg" | |
| mkdir macos-dist | |
| mv "fmcsadmin-${{ env.fmcsadmin_version }}.pkg" macos-dist/ | |
| mv {LICENSE.txt,README.md,NOTICE.txt,release-notes.txt} macos-dist/ | |
| cd macos-dist | |
| cd .. | |
| hdiutil create -srcfolder ./macos-dist/ -fs HFS+ -format UDZO -volname "fmcsadmin-${{ env.fmcsadmin_version }}" "fmcsadmin-${{ env.fmcsadmin_version }}-macos.dmg" |