Publish to Apache nightlies server (#60)

This commit is contained in:
Sean Glover 2023-01-14 13:47:15 -05:00 committed by GitHub
parent 4ac0f00a47
commit 281a086897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 213 additions and 19 deletions

View file

@ -0,0 +1,86 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Based on Apache Arrow's sync-nightlies action
# https://github.com/apache/arrow/blob/master/.github/actions/sync-nightlies/action.yml
name: 'Sync Nightlies'
description: 'Sync files to and from nightlies.apache.org'
inputs:
upload:
description: 'Sync from local to remote'
default: false
required: false
switches:
description: 'see rsync --help'
required: true
local_path:
description: 'The relative local path within $GITHUB_WORKSPACE'
required: true
remote_path:
description: 'The remote path incl. sub dirs e.g. {{secrets.path}}/arrow/r'
required: true
remote_host:
description: 'The remote host'
required: true
remote_port:
description: 'The remote port'
required: false
default: 22
remote_user:
description: 'The remote user'
required: true
remote_key:
description: 'The remote key'
required: true
runs:
using: "composite"
steps:
- name: Sync files
shell: bash
env:
SWITCHES: "${{ inputs.switches }}"
LOCAL_PATH: "${{ github.workspace }}/${{ inputs.local_path }}"
SSH_KEY: "${{ inputs.remote_key }}"
PORT: "${{ inputs.remote_port }}"
USER: "${{ inputs.remote_user }}"
HOST: "${{ inputs.remote_host }}"
REMOTE_PATH: "${{ inputs.remote_path }}"
run: |
# Make SSH key available and add remote to known hosts
eval "$(ssh-agent)" > /dev/null
echo "$SSH_KEY" | tr -d '\r' | ssh-add - >/dev/null
mkdir -p .ssh
chmod go-rwx .ssh
echo "$HOST_KEY" >> .ssh/known_hosts
# strict errors
set -eu
# We have to use a custom RSH to supply the port
RSH="ssh -o StrictHostKeyChecking=no -p $PORT"
DSN="$USER@$HOST"
# It is important to append '/' to the source path otherwise
# the entire source dir will be created as a sub dir in the destination
if [ "${{ inputs.upload }}" = true ]
then
SOURCE=$LOCAL_PATH/
DEST=$DSN:$REMOTE_PATH
else
SOURCE=$DSN:$REMOTE_PATH/
DEST=$LOCAL_PATH
fi
rsync $SWITCHES --rsh="$RSH" $SOURCE $DEST

116
.github/workflows/publish-nightly.yml vendored Normal file
View file

@ -0,0 +1,116 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Based on Apache Arrow's java-nightly workflow
# https://github.com/apache/arrow/blob/master/.github/workflows/java_nightly.yml
name: Publish nightly artifacts
on:
workflow_dispatch:
inputs:
keep:
description: Number of versions to keep.
required: false
default: 30
schedule:
- cron: "0 0 * * *"
push:
branches:
- 'main'
permissions:
contents: read
jobs:
publish-nightly:
name: Publish nightly
runs-on: ubuntu-20.04
if: github.repository == 'apache/incubator-pekko'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: olafurpg/setup-scala@v13
with:
java-version: adopt@1.11
- name: Publish local
run: |-
sudo apt-get install graphviz
# disable mima check until first pekko release is done
# sbt +mimaReportBinaryIssues
sbt +publishM2
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0
- name: Sync from remote
uses: ./.github/actions/sync-nightlies
with:
switches: -avzh --update --delete --progress
local_path: repo
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/pekko/snapshots
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- shell: bash
name: Show local repo sync from remote
run: |
for i in `ls -t repo/org/apache/pekko/`; do
echo "- $i: $(find repo/org/apache/pekko/$i -mindepth 1 -maxdepth 1 -type d \
| wc -l \
| xargs) versions available"
done
- shell: bash
name: Copy snapshots from local m2 repository
run: |
mkdir -p repo/org/apache/pekko/
cp -R $HOME/.m2/repository/org/apache/pekko/ repo/org/apache
- name: Prune repository
shell: bash
env:
KEEP: ${{ github.event.inputs.keep || 30 }}
run: |
for i in `ls -t repo/org/apache/pekko/`; do
find repo/org/apache/pekko/$i -mindepth 1 -maxdepth 1 -type d -print0 \
| xargs -0 ls -t -d \
| tail -n +$((KEEP + 1)) \
| xargs rm -rf
done
- name: Show repo contents
run: tree repo
- name: Sync to Remote
if: ${{ github.repository == 'apache/incubator-pekko' }}
uses: ./.github/actions/sync-nightlies
with:
upload: true
switches: -avzh --omit-dir-times --update --delete --progress
local_path: repo
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/pekko/snapshots
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}

View file

@ -2,12 +2,6 @@ name: Publish
on:
push:
branches:
- master
- main
# for testing the GH Action without merging to main,
# in some cases
- test-publish-snapshots
tags: ["*"]
jobs:

View file

@ -51,8 +51,6 @@ scaladoc generation build task, which is part of the release.
## Snapshot releases
To create snapshot versions manually, use `sbt clean publishLocal`.
If you have access, you can use `+publishSigned` to publish them to
sonatype.
## Releasing only updated docs

View file

@ -32,11 +32,11 @@ All Akka releases are published via Sonatype to Maven Central, see
## Snapshots Repository
Snapshot builds are available at [https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/](https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/). All Akka modules that belong to the same build have the same version.
Snapshot builds are published nightly and are available for 30 days at [https://nightlies.apache.org/pekko/snapshots/org/apache/pekko/](https://nightlies.apache.org/pekko/snapshots/org/apache/pekko/). All Apache Pekko modules that belong to the same build have the same version.
@@@ warning
The use of Akka SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing.
The use of Apache Pekko SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing.
@@@
@ -45,7 +45,7 @@ The use of Akka SNAPSHOTs, nightlies and milestone releases is discouraged unles
Make sure that you add the repository to the sbt resolvers:
```
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
resolvers ++= "Apache Pekko Snapshots" at "https://nightlies.apache.org/pekko/snapshots"
```
Define the library dependencies with the complete version. For example:
@ -63,8 +63,8 @@ Make sure that you add the repository to the Maven repositories in pom.xml:
```
<repositories>
<repository>
<id>oss-sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>apache-pekko-snapshots</id>
<url>https://nightlies.apache.org/pekko/snapshots</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>

View file

@ -1,19 +1,19 @@
# Scala 3 support
Akka has experimental support for Scala 3.
Apache Pekko has experimental support for Scala 3.
## Using 2.13 artifacts in Scala 3
You can use [CrossVersion.for3Use2_13](https://scala-lang.org/blog/2021/04/08/scala-3-in-sbt.html#using-scala-213-libraries-in-scala-3)
to use the regular 2.13 Akka artifacts in a Scala 3 project. This has been
to use the regular 2.13 Apache Pekko artifacts in a Scala 3 project. This has been
shown to be successful for Streams, HTTP and gRPC-heavy applications.
## Scala 3 artifacts
Starting with Akka version 2.6.18 (and on current [development snapshots](https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_3/)),
we are publishing experimental Scala 3 artifacts that can be used 'directly'
(without `CrossVersion`) with Scala 3.
Experimental Scala 3 artifacts are published.
We encourage you to try out these artifacts and [report any findings](https://github.com/akka/akka/issues?q=is%3Aopen+is%3Aissue+label%3At%3Ascala-3).
[Development snapshots](https://nightlies.apache.org/pekko/snapshots/org/apache/pekko/pekko-actor_3/) can be found in the snapshots repository.
We encourage you to try out these artifacts and [report any findings](https://github.com/apache/incubator-pekko/issues?q=is%3Aopen+is%3Aissue+label%3At%3Ascala-3).
We do not promise @ref:[binary compatibility](../common/binary-compatibility-rules.md) for these artifacts yet.