Skip to content

Commit

Permalink
ICU-21733 Actions for building C/J demos (#29)
Browse files Browse the repository at this point in the history
* ICU-21733 actions for icu4jweb

* ICU-21733 actions for icu4cdemos and iucsamples

* ICU-21733 actions to build and deploy on tag

* typo
  • Loading branch information
srl295 authored Oct 8, 2021
1 parent c826a56 commit 60ddc8e
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/icu4c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build ICU4C Demos

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# ccache?
- name: Cache apk
uses: actions/cache@v2
with:
path: ~/.apk
key: apk
restore-keys: |
apk
- name: Build iucsamples4c with docker
run: >
cd iucsamples/c && docker run --rm -v $HOME/.apk:/etc/apk/cache -v $(pwd)/:/usr/src -w /usr/src alpine:edge sh -c "apk --update add gcc make g++ bsd-compat-headers pkgconfig icu-dev && make all check"
- name: Build icudemos with docker
run: >
cd icu-kube && sh build.sh
# TODO: non-docker build?
36 changes: 36 additions & 0 deletions .github/workflows/icu4j.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build ICU4J Demos

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: >
mvn --file icu4jweb/pom.xml -s .github/workflows/mvn-settings.xml -B package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build container unicode/icu4jweb
run: >
cd icu4jweb ; bash build-docker.sh
- name: Build iucsamples4j
run: >
mvn --file iucsamples/j/icu2work/pom.xml -s .github/workflows/mvn-settings.xml -B test
58 changes: 58 additions & 0 deletions .github/workflows/mvn-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
Copyright © 1991 and later Unicode, Inc.
All rights reserved.
License and terms of use: http://www.unicode.org/copyright.html
This file is used during builds to be able to access a temporary copy
of icu4j.jar and utilities.jar. See CLDR-11585.
TODO: Remove this when ICU-21251 is completed.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<!-- the 'central' repository is already defined by default. -->
<repository>
<id>github</id>
<name>GitHub unicode-org/cldr Apache Maven Packages</name>
<url>https://maven.pkg.github.com/unicode-org/cldr</url>
</repository>
<repository>
<id>githubicu</id>
<name>GitHub unicode-org/icu Apache Maven Packages</name>
<url>https://maven.pkg.github.com/unicode-org/icu</url>
</repository>
<repository>
<id>githubcldr</id>
<name>GitHub unicode-org/cldr Apache Maven Packages</name>
<url>https://maven.pkg.github.com/unicode-org/cldr</url>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${GITHUB_ACTOR}</username>
<password>${GITHUB_TOKEN}</password>
</server>
<server>
<id>githubicu</id>
<username>${GITHUB_ACTOR}</username>
<password>${GITHUB_TOKEN}</password>
</server>
<server>
<id>githubcldr</id>
<username>${GITHUB_ACTOR}</username>
<password>${GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
50 changes: 50 additions & 0 deletions .github/workflows/upload-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Push to GCR Github Action
on:
push:
tags:
- '*'
jobs:
build-and-push-to-gcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build icu4jweb with Maven
run: >
mvn --file icu4jweb/pom.xml -s .github/workflows/mvn-settings.xml -B package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get the tag name
id: get_tag_name
run: echo ::set-output name=GIT_TAG_NAME::${GITHUB_REF/refs\/tags\//}
- name: Build and Upload ICU4C-Demos Container
uses: RafikFarhad/push-to-gcr-github-action@v3
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: us.gcr.io
project_id: icu4c-demos
image_name: icu4c-demos
image_tag: ${{ steps.get_tag_name.outputs.GIT_TAG_NAME}}
dockerfile: icu-kube/docker.d/icu4c-demos/Dockerfile
context: .
build_args: ICU_PATH=system
- name: Build and Upload ICU4J-Demos Container
uses: RafikFarhad/push-to-gcr-github-action@v3
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: us.gcr.io
project_id: icu4c-demos
image_name: icu4j-demos
image_tag: ${{ steps.get_tag_name.outputs.GIT_TAG_NAME}}
dockerfile: icu4jweb/Dockerfile
context: icu4jweb

0 comments on commit 60ddc8e

Please sign in to comment.