Skip to content

Commit

Permalink
Merge pull request #3 from emic/develop
Browse files Browse the repository at this point in the history
Release XMLPaste 1.1.0
  • Loading branch information
matsuo authored Aug 6, 2024
2 parents 86718c7 + 4b6d968 commit 1ca0d86
Show file tree
Hide file tree
Showing 13 changed files with 218 additions and 49 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: build

on: [ push, pull_request ]

jobs:

build:
name: Build
runs-on: ${{ matrix.os }}

strategy:
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
os: [ macos-12, macos-13, macos-14, macos-latest, windows-2019, windows-2022, windows-latest ]
go: [ '1.22' ]
steps:

- name: Setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
cache: false
go-version: ${{ matrix.go }}
check-latest: true

- uses: actions/checkout@v4

- shell: bash
run: echo "xmlpaste_version=1.1.0" >> "$GITHUB_ENV"

- if: runner.os == 'macOS'
run: make dist && cp -p "dist/xmlpaste-${{ env.xmlpaste_version }}-macos/xmlpaste" .

- if: runner.os == 'Windows'
run: go build -ldflags "-X main.version=${{ env.xmlpaste_version }}" xmlpaste.go xmlpaste_windows.go

- shell: bash
run: echo "goss_commit_hash=aed56336c3e8ff683e9540065b502f423dd6760d" >> "$GITHUB_ENV" # v0.4.8

- shell: bash
run: echo "GOSS_USE_ALPHA=1" >> "$GITHUB_ENV"

- if: runner.os == 'macOS'
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: 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: ./xmlpaste -v

# based on: github.com/koron-go/_skeleton/.github/workflows/go.yml
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: release

on:
push:
tags:
- '*'

jobs:
build:
name: Release
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
go: [ '1.22' ]
steps:

- name: Setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
cache: false
go-version: ${{ matrix.go }}

- uses: actions/checkout@v4

- run: make dist


- name: Set version
id: version
run: |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
- name: Create release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: XMLPaste ${{ steps.version.outputs.version }} Released
draft: true
prerelease: false

- name: Upload Release Asset for Windows (x64)
id: upload-release-asset-for-windows-x64
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/xmlpaste-${{ steps.version.outputs.version }}-windows-x64.zip
asset_name: xmlpaste-${{ steps.version.outputs.version }}-windows-x64.zip
asset_content_type: application/zip
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Emic Corporation
Copyright (c) 2019-2024 Emic Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
45 changes: 30 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
NAME=xmlpaste
VERSION=1.0.1-dev
VERSION=1.1.0

GOCMD=go
GOBUILD=$(GOCMD) build
DIST_DIR=dist
MACOS_DIR=macos
MACOS_ALT_DIR=macos-alt
WINDOWS_DIR=windows-x64
WINDOWS_32BIT_DIR=windows-x32
DIST_MACOS_DIR=$(NAME)-$(VERSION)-$(MACOS_DIR)
DIST_WINDOWS_DIR=$(NAME)-$(VERSION)-$(WINDOWS_DIR)
DIST_WINDOWS_32BIT_DIR=$(NAME)-$(VERSION)-$(WINDOWS_32BIT_DIR)

all: build

.PHONY: clean
clean:
@rm -rf $(DIST_DIR)

build: build-macos build-windows build-windows-32bit
build: build-macos build-windows

ifeq ($(shell uname -m),x86_64)
build-macos:
mkdir -p $(DIST_DIR)/$(MACOS_DIR)
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 $(GOBUILD) -ldflags "-X main.version=$(VERSION)" -o $(DIST_DIR)/$(MACOS_DIR)/$(NAME)
else
build-macos:
mkdir -p $(DIST_DIR)/$(MACOS_DIR)
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 $(GOBUILD) -ldflags "-X main.version=$(VERSION)" -o $(DIST_DIR)/$(MACOS_DIR)/$(NAME)
endif

ifeq ($(shell uname -m),x86_64)
build-macos-alt:
mkdir -p $(DIST_DIR)/$(MACOS_ALT_DIR)
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 $(GOBUILD) -ldflags "-X main.version=$(VERSION)" -o $(DIST_DIR)/$(MACOS_ALT_DIR)/$(NAME)
else
build-macos-alt:
mkdir -p $(DIST_DIR)/$(MACOS_ALT_DIR)
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 $(GOBUILD) -ldflags "-X main.version=$(VERSION)" -o $(DIST_DIR)/$(MACOS_ALT_DIR)/$(NAME)
endif

build-windows:
mkdir -p $(DIST_DIR)/$(WINDOWS_DIR)
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 $(GOBUILD) -ldflags "-X main.version=$(VERSION)" -o $(DIST_DIR)/$(WINDOWS_DIR)/$(NAME).exe

build-windows-32bit:
mkdir -p $(DIST_DIR)/$(WINDOWS_32BIT_DIR)
GOOS=windows GOARCH=386 CGO_ENABLED=0 $(GOBUILD) -ldflags "-X main.version=$(VERSION)" -o $(DIST_DIR)/$(WINDOWS_32BIT_DIR)/$(NAME).exe

.PHONY: dist
dist: build
dist-multiplatform: build
cd $(DIST_DIR) && \
mv $(MACOS_DIR) $(DIST_MACOS_DIR) && \
cp -p ../LICENSE.txt $(DIST_MACOS_DIR)/ && \
cp -p ../README.md $(DIST_MACOS_DIR)/ && \
cp -p ../release-notes.txt $(DIST_MACOS_DIR)/ && \
zip -r $(DIST_MACOS_DIR).zip $(DIST_MACOS_DIR) && \
cd ..

cd $(DIST_DIR) && \
Expand All @@ -49,10 +59,15 @@ dist: build
zip -r $(DIST_WINDOWS_DIR).zip $(DIST_WINDOWS_DIR) && \
cd ..

ifeq ($(shell uname),Darwin)
dist: dist-multiplatform build-macos-alt
cd $(DIST_DIR) && \
mv $(WINDOWS_32BIT_DIR) $(DIST_WINDOWS_32BIT_DIR) && \
cp -p ../LICENSE.txt $(DIST_WINDOWS_32BIT_DIR)/ && \
cp -p ../README.md $(DIST_WINDOWS_32BIT_DIR)/ && \
cp -p ../release-notes.txt $(DIST_WINDOWS_32BIT_DIR)/ && \
zip -r $(DIST_WINDOWS_32BIT_DIR).zip $(DIST_WINDOWS_32BIT_DIR) && \
mv $(DIST_MACOS_DIR)/$(NAME) $(DIST_MACOS_DIR)/$(NAME).tmp && \
lipo -create $(DIST_MACOS_DIR)/$(NAME).tmp $(MACOS_ALT_DIR)/$(NAME) -output $(DIST_MACOS_DIR)/$(NAME) && \
rm -f $(MACOS_ALT_DIR)/$(NAME) && \
rmdir $(MACOS_ALT_DIR) && \
rm -f $(DIST_MACOS_DIR)/$(NAME).tmp && \
cd ..
else
dist: dist-multiplatform
endif
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ set the clipboard to (xml as text)
```


Supported Versions
-----
Please see details: https://support.claris.com/s/article/Claris-support-policy?language=en_US
- Claris FileMaker Pro 2024 (until June 2026)
- Claris FileMaker Pro 2023 (until Apr 2025)
- Claris FileMaker Pro 19.6 (until Dec 2024)


System Requirements
-----
- OS X Yosemite v10.10 or later (tested on macOS Mojave 10.14)
- Windows 7 or later (tested on Windows 10)
- macOS version : macOS Monterey 12, macOS Ventura 13 or macOS Sonoma 14
- Windows version : Windows 10 Version 22H2 or Windows 11


Download
Expand All @@ -50,4 +58,4 @@ Emic Corporation <https://www.emic.co.jp/>

License
-----
This software is distributed under the MIT License.
This software is distributed under the MIT License.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/emic/XMLPaste

go 1.22
4 changes: 2 additions & 2 deletions macOS/Distribution.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>XMLPaste 1.0.0</title>
<title>XMLPaste 1.1.0</title>
<welcome file="welcome.txt" />
<license file="LICENSE.txt" />
<pkg-ref id="jp.co.emic.xmlpaste"/>
Expand All @@ -14,5 +14,5 @@
<choice id="jp.co.emic.xmlpaste" visible="false">
<pkg-ref id="jp.co.emic.xmlpaste"/>
</choice>
<pkg-ref id="jp.co.emic.xmlpaste" version="1.0.0" onConclusion="none">xmlpaste.pkg</pkg-ref>
<pkg-ref id="jp.co.emic.xmlpaste" version="1.1.0" onConclusion="none">xmlpaste.pkg</pkg-ref>
</installer-gui-script>
1 change: 1 addition & 0 deletions macOS/welcome.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XMLPaste is a command line tool to paste XML text of FileMaker clipboard objects.
16 changes: 13 additions & 3 deletions release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
XMLPaste
(c) 2019 Emic Corporation <https://www.emic.co.jp/>
(c) 2019-2024 Emic Corporation <https://www.emic.co.jp/>
This software is distributed under the MIT License.

Version: 1.0.1 (in development)
-
Version: 1.1.0
Date: August 6, 2024
- Add support for Apple Silicon on macOS.
- Add support for Claris FileMaker Pro 19.6, 2023 and 2024.
- Add support for macOS Monterey 12, macOS Ventura 13 and macOS Sonoma 14.
- Add support for Windows 11.
- Built with Go 1.22.
- [INFO] Drop support for Claris FileMaker Pro 19.5 or previous.
- [INFO] Drop support for 32-bit Windows version.
- [INFO] Drop support for Windows 10 Version 21H2 or previous.
- [INFO] Drop support for Windows 7.
- [INFO] Drop support for macOS Catalina 10.15 or previous.

Version: 1.0.0
Date: April 5, 2019
Expand Down
24 changes: 24 additions & 0 deletions tests/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
command:
{{if eq .Env.OS "darwin"}}
print-version:
exec: "./xmlpaste -v"
exit-status: 0
stdout:
- "1.1.0"
{{end}}

{{if eq .Env.OS "windows"}}
print-version:
exec: "xmlpaste.exe -v"
exit-status: 0
stdout: "XMLPaste 1.1.0\n"
{{end}}

{{if eq .Env.OS "darwin"}}
check-universal-binary-or-not:
exec: "file ./xmlpaste"
exit-status: 0
stdout:
- "Mach-O 64-bit executable x86_64"
- "Mach-O 64-bit executable arm64"
{{end}}
3 changes: 2 additions & 1 deletion xmlpaste_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const char *paste() {
// dyn.ah62d4rv4gk8zuxnqm6: Layout Object (.fp7)
// dyn.ah62d4rv4gk8zuxnqgk: Layout Object (.fmp12)
// dyn.ah62d4rv4gk8zuxn0mu: Value List
// dyn.agk8u : Theme
// dyn.agk8u : Theme (FileMaker 17, 18, 19 and 2023)
// dyn.ah62d4rv4gk8zuxnyma: Theme (FileMaker 2024)
// public.utf16-plain-text: Custom Menu
NSData* data = [myPasteboard dataForType:type];
if (data) {
Expand Down
1 change: 1 addition & 0 deletions xmlpaste_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func getClipboard() (string, error) {
"Mac-XML2": "Layout Object (.fmp12)",
"Mac-XMVL": "Value List",
"Mac-": "Theme",
"Mac-XMTH": "Theme (2024)",
}
clipboardType := string((*[1 << 4]byte)(unsafe.Pointer(&buf[0]))[0 : maxCount-1])
if _, ex := clipboardTypes[clipboardType]; !ex && !(clipboardType[0:4] == "Mac-" && clipboardType[0:6] != "Mac-XM") {
Expand Down

0 comments on commit 1ca0d86

Please sign in to comment.