-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(WIP) Replace AzurePipelines by GitHub Actions
- Loading branch information
Showing
3 changed files
with
66 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,14 @@ | ||
pool: | ||
vmImage: 'ubuntu-20.04' | ||
steps: | ||
- bash: ./render.sh | ||
displayName: Build | ||
# TODO test repository_dispatch | ||
# FIXME repository | ||
# FIXME ref | ||
- bash: | | ||
set -e | ||
WORKING_DIR="`pwd`/work" | ||
RESULT_DIR=$WORKING_DIR/result | ||
TEMP=/tmp/jacoco-snapshot | ||
mkdir $TEMP | ||
wget -O $TEMP/download.zip "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.jacoco&a=jacoco&e=zip&v=LATEST" | ||
unzip $TEMP/download.zip -d $TEMP | ||
TARGET=$RESULT_DIR/jacoco/trunk | ||
mkdir $TARGET | ||
cp $TEMP/index.html $TARGET | ||
cp -r $TEMP/doc $TARGET/doc | ||
cp -r $TEMP/test $TARGET/test | ||
cp -r $TEMP/coverage $TARGET/coverage | ||
cd work/result | ||
# https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/ | ||
touch .nojekyll | ||
git init | ||
git config user.name ${GIT_COMMITTER_NAME} | ||
git config user.email ${GIT_COMMITTER_EMAIL} | ||
git add . | ||
git commit -q -m "Automatic deployment" | ||
git push --force "https://${GH_TOKEN}@github.com/jacoco/jacoco.github.io" master > /dev/null 2>&1 | ||
echo "www.jacoco.org" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD | ||
git push --force "https://${GH_TOKEN}@github.com/jacoco/jacoco.org" master:gh-pages > /dev/null 2>&1 | ||
echo "www.eclemma.org" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD | ||
git push --force "https://${GH_TOKEN}@github.com/jacoco/eclemma.org" master:gh-pages > /dev/null 2>&1 | ||
echo "www.eclemma.com" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD | ||
git push --force "https://${GH_TOKEN}@github.com/jacoco/eclemma.com" master:gh-pages > /dev/null 2>&1 | ||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) | ||
curl --data '{"event_type": "jacoco build"}' \ | ||
-H "Authorization: token ${GH_TOKEN}" \ | ||
https://api.github.com/repos/Godin/www.eclemma.org/dispatches | ||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/pull/56/merge')) | ||
displayName: Deploy | ||
env: | ||
GIT_COMMITTER_NAME: $(GIT_COMMITTER_NAME) | ||
GIT_COMMITTER_EMAIL: $(GIT_COMMITTER_EMAIL) | ||
GH_TOKEN: $(GH_TOKEN) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
- repository_dispatch | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
# TODO repository and ref | ||
environment: ${{ (github.repository == 'Godin/www.eclemma.org' && github.ref == 'refs/heads/github-actions') && 'sites' || null }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
- name: 'Build' | ||
run: ./render.sh | ||
- name: 'Deploy' | ||
if: ${{ (github.repository == 'Godin/www.eclemma.org' && github.ref == 'refs/heads/github-actions') }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
run: | | ||
WORKING_DIR="`pwd`/work" | ||
RESULT_DIR=$WORKING_DIR/result | ||
TEMP=/tmp/jacoco-snapshot | ||
mkdir $TEMP | ||
wget -O $TEMP/download.zip "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.jacoco&a=jacoco&e=zip&v=LATEST" | ||
unzip $TEMP/download.zip -d $TEMP | ||
TARGET=$RESULT_DIR/jacoco/trunk | ||
mkdir $TARGET | ||
cp $TEMP/index.html $TARGET | ||
cp -r $TEMP/doc $TARGET/doc | ||
cp -r $TEMP/test $TARGET/test | ||
cp -r $TEMP/coverage $TARGET/coverage | ||
cd work/result | ||
# https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/ | ||
touch .nojekyll | ||
git init | ||
git config user.name ${GIT_COMMITTER_NAME} | ||
git config user.email ${GIT_COMMITTER_EMAIL} | ||
git add . | ||
git commit -q -m "Automatic deployment" | ||
git push --force "https://${GH_TOKEN}@github.com/jacoco/jacoco.github.io" master > /dev/null 2>&1 | ||
#echo "www.jacoco.org" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD | ||
#git push --force "https://${GH_TOKEN}@github.com/jacoco/jacoco.org" master:gh-pages > /dev/null 2>&1 | ||
#echo "www.eclemma.org" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD | ||
#git push --force "https://${GH_TOKEN}@github.com/jacoco/eclemma.org" master:gh-pages > /dev/null 2>&1 | ||
#echo "www.eclemma.com" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD | ||
#git push --force "https://${GH_TOKEN}@github.com/jacoco/eclemma.com" master:gh-pages > /dev/null 2>&1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[![Build Status](https://dev.azure.com/jacoco-org/JaCoCo/_apis/build/status/Site?branchName=master)](https://dev.azure.com/jacoco-org/JaCoCo/_build/latest?definitionId=2&branchName=master) | ||
[![Build Status](https://github.com/jacoco/www.eclemma.org/actions/workflows/ci.yml/badge.svg)](https://github.com/jacoco/www.eclemma.org/actions/workflows/ci.yml) |