Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #371
This file contains 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 and Release | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
build_for_linux: | |
runs-on: ubuntu-latest | |
name: Build for Linux | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache Docker layers | |
uses: satackey/[email protected] | |
with: | |
key: docker-layers-linux-{hash} | |
restore-keys: | | |
docker-layers-linux- | |
# Ignore the failure of a step and avoid terminating the job. | |
continue-on-error: true | |
- name: Build Docker builder image | |
run: docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f .github/docker/linux/Dockerfile -t builder . | |
- name: Build | |
run: docker run --rm -e CI -v $(pwd):/app -w /app builder | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jvips-libs-linux | |
path: JVips-libs.tar.gz | |
build_for_windows: | |
runs-on: ubuntu-latest | |
name: Build for Windows | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build Docker builder image | |
run: docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f .github/docker/windows/Dockerfile -t builder . | |
- name: Build | |
run: docker run --rm -e CI -v $(pwd):/app -w /app builder | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jvips-libs-windows | |
path: JVips-libs.tar.gz | |
build_for_macos: | |
runs-on: macos-latest | |
name: Build for macOS | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Select Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "1.8.0" | |
java-package: jdk | |
architecture: x64 | |
- name: Install vips | |
run: ./setup-for-macos.sh | |
- name: Build | |
run: ./build.sh --with-macos --without-w64 --without-linux | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jvips-libs-macos | |
path: JVips-libs.tar.gz | |
release: | |
needs: [build_for_linux, build_for_macos, build_for_windows] | |
if: contains('refs/heads/master', github.ref) | |
runs-on: ubuntu-latest | |
name: Merge macOS, Linux, Windows artifacts into a JAR and release it | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Read GPG private key | |
run: echo -ne "$GPG_PRIVATE_KEY" | base64 --decode > $RUNNER_TEMP/key.asc | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.MAVEN_SECRING_GPG_BASE64 }} | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
path: artifacts | |
- name: Extract libraries | |
run: for jar in artifacts/*/JVips-libs.tar.gz; do tar xvf $jar; done | |
- name: Set version | |
id: version | |
run: | | |
source lib/VERSIONS | |
VERSION="${VIPS_VERSION}-$(git rev-parse --short HEAD)" | |
mvn -B versions:set -DnewVersion=$VERSION | |
echo "::set-output name=version::$VERSION" | |
- name: Set up Maven Central Repository | |
uses: warrenseine/setup-java@v1 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
with: | |
java-version: "1.8.0" | |
java-package: jdk | |
architecture: x64 | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key-path: ${{ runner.temp }}/key.asc | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Clean GPG private key | |
if: ${{ always() }} | |
run: rm -f $RUNNER_TEMP/key.asc | |
- name: Publish to the Maven Central Repository | |
run: mvn -B -DskipTests -P deploy deploy | |
env: | |
MAVEN_USERNAME: criteo-oss | |
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_SECRING_PASSWORD }} | |
# - name: Publish to GitHub Packages | |
# run: mvn -B -DskipTests -P deploy deploy | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jvips | |
path: JVips.jar | |
- name: Create release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
release_name: ${{ steps.version.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: JVips.jar | |
asset_name: JVips.jar | |
asset_content_type: application/java-archive |