blob: e9885b0375b22f8fb673ce3edd9a3b1bbfaeca6d [file]
# 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.
#
name: Build OpenServerless OpenWhisk 2 Standalone native executable
on:
workflow_dispatch:
inputs:
tag:
description: 'Release version (e.g., v1.2.3)'
required: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
target: linux
extension: ''
- os: macos-latest
target: macos
extension: ''
name: Build native for ${{ matrix.target }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup CI
run: bash .github/cisetup.sh
shell: bash
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '17.0.9'
- name: Assign TAG from pull request
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "IMG_TAG=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
shell: bash
- name: Assign TAG from push
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
shell: bash
- name: Assign native standalone executable name
run: |
ARCH=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
PLATFORM=$(echo "${{ matrix.target }}" | tr '[:upper:]' '[:lower:]')
FILENAME="openwhisk-standalone-${PLATFORM}-${ARCH}-${IMG_TAG}${{ matrix.extension }}"
echo "NATIVE_IMAGE_NAME=$FILENAME" >> $GITHUB_ENV
shell: bash
- name: Native Image
run: task native:standalone-build
shell: bash
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: standalone/dist/$NATIVE_IMAGE_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}