diff --git a/.github/workflows/icu4c.yml b/.github/workflows/icu4c.yml new file mode 100644 index 00000000..64024c6a --- /dev/null +++ b/.github/workflows/icu4c.yml @@ -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? diff --git a/.github/workflows/icu4j.yml b/.github/workflows/icu4j.yml new file mode 100644 index 00000000..e113b3a5 --- /dev/null +++ b/.github/workflows/icu4j.yml @@ -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 diff --git a/.github/workflows/mvn-settings.xml b/.github/workflows/mvn-settings.xml new file mode 100644 index 00000000..f3b33185 --- /dev/null +++ b/.github/workflows/mvn-settings.xml @@ -0,0 +1,58 @@ + + + + github + + + + github + + + + github + GitHub unicode-org/cldr Apache Maven Packages + https://maven.pkg.github.com/unicode-org/cldr + + + githubicu + GitHub unicode-org/icu Apache Maven Packages + https://maven.pkg.github.com/unicode-org/icu + + + githubcldr + GitHub unicode-org/cldr Apache Maven Packages + https://maven.pkg.github.com/unicode-org/cldr + + + + + + + + github + ${GITHUB_ACTOR} + ${GITHUB_TOKEN} + + + githubicu + ${GITHUB_ACTOR} + ${GITHUB_TOKEN} + + + githubcldr + ${GITHUB_ACTOR} + ${GITHUB_TOKEN} + + + diff --git a/.github/workflows/upload-on-tag.yml b/.github/workflows/upload-on-tag.yml new file mode 100644 index 00000000..44d0aefa --- /dev/null +++ b/.github/workflows/upload-on-tag.yml @@ -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