Skip to content

Commit a582273

Browse files
raulrajaJavierSegoviaCordobanomisRevfranciscodr
authoredDec 1, 2021
Simplify Gradle layout, + KNIT, - ANK and fix site code fences (#2584)
* Remove nested Gradle config * Remove Ank and Dokka Workaround plugin * Progress with knit fixing imports * knit generated examples compiling * knit generated examples compiling * make snippets -new * Update Arrow Core KNIT tags * Update Arrow Fx Coroutines KNIT tags * Updatee Arrow Fx STM KNIT tags * Update Arrow Fx Coroutines Test KNIT tags * Update Arrow Optics KNIT tags * Explicitely point to arrow-libs * Remove comments * make examples compile * Progress with knit fixing imports in Validated * Progress with knit fixing imports in Validated (INCLUDES) * more knit fixes * remove knit test examples * knit fixes for retrofit example * attempt to fix pull request workflow build * code fences showing but strange character `\` appearing in code fences * attempt to fix code fences in docs * fix result computation and Option knit examples * knit fixes for Ior * fixes for Either, Validated and Option * resolve compile error * resolve compile error * Update the doc publish workflow Co-authored-by: Javier Segovia Córdoba <javier@segoviacordoba.com> Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com> Co-authored-by: Imran <im> Co-authored-by: franciscodr <francisco.d@47deg.com>
1 parent d1bd27e commit a582273

File tree

505 files changed

+7754
-3674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

505 files changed

+7754
-3674
lines changed
 

‎.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.{kt,kts}]
2+
indent_size = 2
3+
insert_final_newline = true
4+
max_line_length = off

‎.github/workflows/publish.yml

+23-46
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
run: ${GITHUB_WORKSPACE}/.github/scripts/show-env.sh
5959

6060
- name: Publish Apple, Linux, JVM & JS targets
61-
working-directory: arrow-libs
6261
run: |
6362
./gradlew publishToSonatype
6463
echo "$(cat $BASEDIR/gradle.properties | grep projects.version | cut -d'=' -f2) Apple, Linux, JVM & JS deployed!"
@@ -96,7 +95,6 @@ jobs:
9695
shell: bash
9796

9897
- name: Publish Windows
99-
working-directory: arrow-libs
10098
run: |
10199
./gradlew publishToSonatype
102100
echo "$(cat gradle.properties | grep projects.version | cut -d'=' -f2) MingwX64 deployed!"
@@ -106,14 +104,14 @@ jobs:
106104

107105
publish_doc:
108106
env:
109-
JAVA_OPTS: -Xms2g -Xmx4g
110-
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs=-Xmx8g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF-8 -Dorg.gradle.parallel=false"
111107
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
112-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
113-
S3_BUCKET: ${{ secrets.S3_BUCKET }}
114108
AWS_CLOUDFRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }}
115109
AWS_DEFAULT_REGION: eu-west-1
110+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
111+
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs=-Xmx8g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF-8 -Dorg.gradle.parallel=false"
112+
JAVA_OPTS: -Xms2g -Xmx4g
116113
JEKYLL_ENV: production
114+
S3_BUCKET: ${{ secrets.S3_BUCKET }}
117115

118116
runs-on: macos-latest
119117
timeout-minutes: 60
@@ -138,90 +136,69 @@ jobs:
138136
run: |
139137
mkdir $BASEDIR/logs
140138
brew install tree
141-
bundle install --gemfile Gemfile --path vendor/bundle
142-
143-
- name: "Assemble"
144-
working-directory: arrow-libs
145-
run: |
146-
echo "Additional step to avoid a random failure with Dokka 0.10.0 and MPP"
147-
./gradlew assemble
139+
bundle config set --local path 'vendor/bundle'
140+
bundle install --gemfile Gemfile
148141
149142
- name: "Create API doc"
150-
working-directory: arrow-libs
151-
run: ./gradlew --no-parallel dokkaGfm
152-
153-
- name: "Validate documentation"
154-
working-directory: arrow-site
155-
run: ./gradlew runAnk
143+
run: ./gradlew dokkaGfm
156144

157145
- name: "Landing page: build"
158-
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
159146
working-directory: arrow-site
147+
if: ${{ github.ref == 'refs/heads/main' }}
160148
run: |
161-
bundle exec jekyll build -b docs -s build/site
149+
bundle exec jekyll build -b docs -s docs
162150
tree _site > $BASEDIR/logs/content.log
163151
164152
- name: "Landing page: publish"
165-
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
166153
working-directory: arrow-site
154+
if: ${{ github.ref == 'refs/heads/main' }}
167155
run: |
168156
echo ">>> Landing page" >> $BASEDIR/logs/aws_sync.log
169157
${GITHUB_WORKSPACE}/.github/scripts/publish-landing-page.sh
170158
171-
- name: "Remove index for versions"
172-
working-directory: arrow-site
173-
run: rm -f build/site/index.md
174-
175-
- name: "Latest release: build (docs/)"
176-
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
177-
working-directory: arrow-site
178-
run: |
179-
bundle exec jekyll build -b docs -s build/site
180-
tree _site > $BASEDIR/logs/content_docs.log
181-
182-
- name: "Latest release: publish (docs/)"
183-
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
159+
- name: "Latest release: publish (/docs)"
184160
working-directory: arrow-site
161+
if: ${{ github.ref == 'refs/heads/main' }}
185162
run: |
186163
echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
187164
${GITHUB_WORKSPACE}/.github/scripts/publish-latest-release.sh
188165
189-
- name: "Latest release: build release directory (docs/<major.minor>)"
190-
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
166+
- name: "Latest release: build release directory (/docs/<major.minor>)"
191167
working-directory: arrow-site
168+
if: ${{ github.ref == 'refs/heads/main' }}
192169
run: |
193170
SHORT_VERSION=$(echo $RELEASE_VERSION | cut -d. -f1-2)
194-
bundle exec jekyll build -b docs/${SHORT_VERSION} -s build/site
171+
bundle exec jekyll build -b docs/${SHORT_VERSION} -s docs
195172
tree _site > $BASEDIR/logs/content_docs-${SHORT_VERSION}.log
196173
197-
- name: "Latest release: publish release directory (docs/<major.minor>)"
198-
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
174+
- name: "Latest release: publish release directory (/docs/<major.minor>)"
199175
working-directory: arrow-site
176+
if: ${{ github.ref == 'refs/heads/main' }}
200177
run: |
201178
SHORT_VERSION=$(echo $RELEASE_VERSION | cut -d. -f1-2)
202179
echo ">>> $SHORT_VERSION VERSION" >> $BASEDIR/logs/aws_sync.log
203180
if [ "${SHORT_VERSION}" != "" ]; then
204-
aws s3 sync _site s3://$S3_BUCKET/docs/$SHORT_VERSION --delete >> $BASEDIR/logs/aws_sync.log
181+
aws s3 sync _site s3://$S3_BUCKET/docs/$SHORT_VERSION --delete --exclude "index.html" >> $BASEDIR/logs/aws_sync.log
205182
else
206183
exit 1
207184
fi
208185
209186
- name: "Next version: build (/docs/next)"
210-
if: ${{ github.ref == 'refs/heads/main' }}
211187
working-directory: arrow-site
188+
if: ${{ github.ref == 'refs/heads/main' }}
212189
run: |
213-
bundle exec jekyll build -b docs/next -s build/site
190+
bundle exec jekyll build -b docs/next -s docs
214191
tree _site > $BASEDIR/logs/content_docs-next.log
215192
216193
- name: "Next version: publish (/docs/next)"
217-
if: ${{ github.ref == 'refs/heads/main' }}
218194
working-directory: arrow-site
195+
if: ${{ github.ref == 'refs/heads/main' }}
219196
run: |
220197
echo ">>> NEXT VERSION" >> $BASEDIR/logs/aws_sync.log
221-
aws s3 sync _site s3://$S3_BUCKET/docs/next --delete >> $BASEDIR/logs/aws_sync.log
198+
aws s3 sync _site s3://$S3_BUCKET/docs/next --delete --exclude "index.html" >> $BASEDIR/logs/aws_sync.log
222199
223200
- name: "Site: publish sitemap.xml"
224-
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
201+
if: ${{ github.ref == 'refs/heads/main' }}
225202
run: |
226203
${GITHUB_WORKSPACE}/.github/scripts/create-sitemap.sh > sitemap.xml
227204
aws s3 cp sitemap.xml s3://$S3_BUCKET/sitemap.xml >> $BASEDIR/logs/aws_sync.log

0 commit comments

Comments
 (0)
Please sign in to comment.