Skip to content

Bump Submodule/github/rest-api-description from e72f353 to 6d0981c #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- macos-latest
# - macos-latest
swift: ["5.9"]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/Dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
# - ubuntu-latest
- macos-latest
swift: ["5.9"]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -27,16 +28,16 @@ jobs:
with:
swift: ${{ matrix.swift }}
os: ${{ matrix.os }}
- run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: touch Submodule
- run: make install
- run: git push
- env:
- name: "Sync code base"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
gh pr checkout ${{ github.event.pull_request.number }}
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
make install
git push
# gh pr review --approve "$PR_URL"
# gh pr merge --auto --merge "$PR_URL"

2 changes: 1 addition & 1 deletion .github/workflows/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
with:
swift-version: ${{ inputs.swift }}
- uses: irgaly/setup-mint@v1
- uses: chrisdickinson/setup-yq@latest
- uses: dcarbone/install-yq[email protected]

# - name: "Xcode Cache"
# if: contains(inputs.os, 'macos')
Expand Down
Empty file removed .nojekyll
Empty file.
60 changes: 30 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
# Special-Targets #
# https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
.DEFAULT_GOAL := install
OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.yaml
.SECONDARY: $(%.yml)
OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.yaml
TAG_NAMES := $(shell yq -r '.tags[].name' $(OPENAPI_PATH))
SUBDIRS := $(addprefix Sources/, $(TAG_NAMES))
SWIFT_FILES := $(addsuffix /Client.swift, $(SUBDIRS))
.SECONDARY : $(%.yml)

%/openapi.yml: $(OPENAPI_PATH)
@mkdir -p "$(@D)"
@ln -sf ../../$(OPENAPI_PATH) $@
@git add $@
@echo "::debug:: make $@"

TAG_NAMES := $(shell yq -r '.tags[].name' $(OPENAPI_PATH))
SUBDIRS := $(addprefix Sources/, $(TAG_NAMES))
OPENAPI_CONFIG_FILES := $(addsuffix /openapi-generator-config.yml, $(SUBDIRS))
%/openapi-generator-config.yml: $(OPENAPI_PATH)
@mkdir -p "$(@D)"
@tag_name=$(shell basename $(shell dirname $@)); \
Expand All @@ -35,24 +35,24 @@ OPENAPI_CONFIG_FILES := $(addsuffix /openapi-generator-config.yml, $(SUBDIRS))
@git add $@
@echo "::debug:: make $@"

SWIFT_FILES := $(addsuffix /Client.swift, $(SUBDIRS))
%/Client.swift: %/openapi.yml %/openapi-generator-config.yml
mint run apple/swift-openapi-generator generate $(@D)/openapi.yml \
--config $(@D)/openapi-generator-config.yml \
--output-directory $(@D)
@git add $(@D)
@git commit -m "[Make] Sync *.swift" >/dev/null \
@git commit -m "[Make] Generate $(@D)/*.swift" >/dev/null \
&& echo "::notice:: make $@" \
|| true

.PHONY: install-$(OPENAPI_PATH)
install-$(OPENAPI_PATH):
ifdef GITHUB_ACTIONS ## https://docs.github.com/en/actions/learn-github-actions/variables
@touch $(OPENAPI_PATH)
@echo "::notice:: make $@"
else
git submodule update --recursive --remote
@git add Submodule
@git commit -m "[Make]$$(git submodule status Submodule/github/rest-api-description)" >/dev/null \
@git commit -m "[Make] Bump$$(git submodule status Submodule/github/rest-api-description)" >/dev/null \
&& touch $(OPENAPI_PATH) \
&& echo "::notice:: make $@" \
|| true
Expand All @@ -61,22 +61,22 @@ endif
install: install-$(OPENAPI_PATH) $(SWIFT_FILES)
@echo "::notice:: make $@"

XCFrameworks:
mint run giginet/Scipio create . \
--static \
--embed-debug-symbols \
--support-simulators
@touch $@
@echo "::notice:: make $@"

%.zip: %.xcframework
@zip -qr "$@" "$<"
@rm -rf "$<"
@git add "$@"
@echo "::debug:: make $@"

install-zips: XCFrameworks
@$(MAKE) $(shell echo XCFrameworks/*.xcframework | sed 's/\.xcframework/\.zip/g');
# XCFrameworks:
# mint run giginet/Scipio create . \
# --static \
# --embed-debug-symbols \
# --support-simulators
# @touch $@
# @echo "::notice:: make $@"
#
# %.zip: %.xcframework
# @zip -qr "$@" "$<"
# @rm -rf "$<"
# @git add "$@"
# @echo "::debug:: make $@"
#
# install-zips: XCFrameworks
# @$(MAKE) $(shell echo XCFrameworks/*.xcframework | sed 's/\.xcframework/\.zip/g');
# @git commit -m "[Make] Modify xcframework zips" || true
# @echo "::notice:: make $@"

Expand All @@ -87,12 +87,12 @@ update-to-date:
touch Sources/**/openapi.yml
touch Sources/**/Client.swift

docs: ## Need env GITHUB_PAGES is created as 'true'
swift package --allow-writing-to-directory $@ generate-documentation \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path github-rest-api-swift-openapi;
sh Script/setupDocsHtml.sh
# docs: ## Need env GITHUB_PAGES is created as 'true'
# swift package --allow-writing-to-directory $@ generate-documentation \
# --disable-indexing \
# --transform-for-static-hosting \
# --hosting-base-path github-rest-api-swift-openapi;
# sh Script/setupDocsHtml.sh

.PHONY: help
.SILENT: help
Expand Down
Loading