Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub actions #2000

Merged
merged 97 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e48fe91
First try
fdodino May 25, 2021
9fc3b59
Adding settings to Maven
fdodino May 25, 2021
336f876
Fix build for Github Actions
fdodino May 25, 2021
9e68318
Removing decryption of settings
fdodino May 25, 2021
76903fb
adding xvbf for QuickFix tests
fdodino May 25, 2021
095a4eb
Running xvfb
fdodino May 25, 2021
3f72925
Fix yaml
fdodino May 25, 2021
2a725da
Fix yaml 2
fdodino May 25, 2021
5d1bcfb
Removing duplicated xvbf
fdodino May 25, 2021
86cf950
Trying to install xvbf manually
fdodino May 25, 2021
118efcf
change xvbf path
fdodino May 25, 2021
e1beba2
Xvfb instead of xvfb
fdodino May 25, 2021
6550aac
using xvfb script
fdodino May 25, 2021
8db28f0
Fix wollok-language pointer + using sh
fdodino May 25, 2021
3a36cda
Running xvfb with sudo
fdodino May 25, 2021
df7d17c
xvfb embedded
fdodino May 25, 2021
4d7e104
xvfb running only for maven script
fdodino May 25, 2021
02f26d6
WIP
fdodino May 29, 2021
202a45a
testing coveralls with secret
fdodino Jun 2, 2021
a2aa871
Missing coveralls report
fdodino Jun 2, 2021
c62273b
Forcing build to use secret
fdodino Jun 2, 2021
245fc59
Upgrading coveralls plugin
fdodino Jun 2, 2021
10463ba
Deleting space for repoToken
fdodino Jun 2, 2021
b183971
adding config for coveralls + github inside pom
fdodino Jun 2, 2021
a35ff5a
Passing only repoToken
fdodino Jun 2, 2021
a8e4e55
Sending coveralls report only to github
fdodino Jun 3, 2021
ac8fc7c
Adding environment variables
fdodino Jun 4, 2021
b64edef
Trying to use github action
fdodino Jun 4, 2021
2b547e9
Back to passing repoToken
fdodino Jun 4, 2021
36748cf
Disabling coverage report from Coveralls - sending from Github
fdodino Jun 4, 2021
2ea7c7d
Trying to use env variable from Github Action
fdodino Jun 4, 2021
7f5376b
Another try
fdodino Jun 4, 2021
972ffb2
Deploy release
fdodino Jun 4, 2021
42ad7e8
Adding service to github action for coveralls
fdodino Jun 4, 2021
8f0cdc1
Adding variables for coveralls
fdodino Jun 4, 2021
51a9ab6
Fix typo in build phase
fdodino Jun 4, 2021
69e92c0
Fix missing env variables for maven coveralls plugin
fdodino Jun 4, 2021
0940983
Releases: trying to add zip files generated
fdodino Jun 5, 2021
4763c8c
Fix ** to automatic release
fdodino Jun 5, 2021
028808f
Uploading only executables zip
fdodino Jun 5, 2021
d7e8444
Adding extra action for tags releasing
fdodino Jun 5, 2021
f9563c7
Decrypting and using settings.xml
fdodino Jun 6, 2021
cdff52f
testing gpg again
fdodino Jun 6, 2021
795344c
gpg: changing params
fdodino Jun 6, 2021
fdfc54e
gpg fix
fdodino Jun 6, 2021
a996cf1
Forcing gnupg install
fdodino Jun 6, 2021
4d3c688
Back to --decrypt at end
fdodino Jun 6, 2021
25c6c95
Confusing gpg arg parser
fdodino Jun 6, 2021
57f706a
Using options file for gpg
fdodino Jun 6, 2021
c5b9b3d
Checking gpg token
fdodino Jun 6, 2021
d3be28e
Testing with -d
fdodino Jun 6, 2021
49309c0
Checking if quotes were the problem
fdodino Jun 6, 2021
bf34aa6
Adding gpg version
fdodino Jun 6, 2021
8cb4f2a
Simplyfing args for gpg
fdodino Jun 6, 2021
b2fc12d
trying magical params
fdodino Jun 6, 2021
2c6d053
Testing again without quotes
fdodino Jun 6, 2021
39e1ed7
GPG mad 1
fdodino Jun 6, 2021
6c22cb0
GPG mad 2
fdodino Jun 6, 2021
87ba59d
Replacing gpg by openssl
fdodino Jun 6, 2021
64a815e
Deleting jfernandes local repo :)
fdodino Jun 6, 2021
9969df2
testing wollok-cli update
fdodino Jun 7, 2021
36c3531
Fix cd scripts
fdodino Jun 7, 2021
b1b724d
Using env
fdodino Jun 7, 2021
da37f46
Testing openssl
fdodino Jun 7, 2021
fb103b7
Testing wollokcli part
fdodino Jun 7, 2021
7ccfc4a
Fix cd
fdodino Jun 7, 2021
8bb1dff
Test 1
fdodino Jun 7, 2021
f14ee8e
Test 2
fdodino Jun 7, 2021
43dbcd4
Test 3
fdodino Jun 7, 2021
4ee463d
Test 4
fdodino Jun 7, 2021
bdfe6a8
Test 4
fdodino Jun 7, 2021
d6f98ce
Test 5
fdodino Jun 7, 2021
6471790
Test 6
fdodino Jun 7, 2021
b4e2620
Test 7
fdodino Jun 7, 2021
4b8d6fc
Testing wollok-cli user
fdodino Jun 7, 2021
9d67b23
Test 8
fdodino Jun 7, 2021
c9a349b
Test 9
fdodino Jun 7, 2021
f33add1
Test 10
fdodino Jun 7, 2021
7f08ccb
Test 11
fdodino Jun 7, 2021
9c02a8d
Fix private key
fdodino Jun 7, 2021
7dbcdf2
Test 12
fdodino Jun 7, 2021
c09ad2d
Test 13
fdodino Jun 7, 2021
f4037ce
Using wollok-cli & wollok-site - test
fdodino Jun 8, 2021
0d5bd1b
Fix env variables for maven process
fdodino Jun 8, 2021
e3d4a26
Separate 2 process for wollok-cli & wollok-site
fdodino Jun 8, 2021
ab9a70a
Fixing directory
fdodino Jun 8, 2021
10cd411
Fix typo in secrets
fdodino Jun 8, 2021
e5a36fc
Changing permissions for private keys
fdodino Jun 8, 2021
322d58f
Using github config
fdodino Jun 8, 2021
4fdc744
Fix directories & use github action id
fdodino Jun 8, 2021
13cdc73
Forcing new build
fdodino Jun 8, 2021
393183d
Adding wollok-cli & wollok-site update only for releasing
fdodino Jun 8, 2021
8729519
If does not work well, back to previous idea
fdodino Jun 8, 2021
6d06b63
Creating PRs programmatically for wollok-cli & wollok-site
fdodino Jun 8, 2021
e9bc30f
Using git rquest-pull
fdodino Jun 8, 2021
7898c7d
testing if
fdodino Jun 9, 2021
e8d9f59
Fixing conditional actions
fdodino Jun 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Java CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Decrypting keys
if: github.ref == 'refs/heads/master'
run: |
echo "Creating ssh"
mkdir ~/.ssh
chmod 755 ~/.ssh
echo "Decrypting wollok-cli"
openssl aes-128-ctr -d -K ${{ secrets.WOLLOK_CLI_KEY }} -iv ${{ secrets.WOLLOK_CLI_IV }} -in ./scripts/wollokcli_key.enc -out ~/.ssh/wollokcli_key
echo "Decrypting wollok-site"
openssl aes-128-ctr -d -K ${{ secrets.WOLLOK_SITE_KEY }} -iv ${{ secrets.WOLLOK_SITE_IV }} -in ./scripts/wolloksite_key.enc -out ~/.ssh/wolloksite_key
chmod 600 ~/.ssh/wollokcli_key ~/.ssh/wolloksite_key
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_JOB: $GITHUB_JOB
- name: Run Maven Build
run: |
openssl aes-256-cbc -pass pass:${{ secrets.SETTINGS_GPG_TOKEN }} -pbkdf2 -in ./settings.xml.enc -out ./settings.xml -d
mv ./settings.xml ~/.m2/settings.xml
export DISPLAY=:99.0
sudo apt-get install -y xvfb
./wollokInstall.sh
cd org.uqbar.project.wollok.releng/
export PROFILES=normalProfile
export UPDATE_SITE=none
echo "Running with profiles $PROFILES"
echo "Running with UPDATE_SITE $UPDATE_SITE"
export MAVEN_OPTS=-Xmx2048m
xvfb-run mvn -e -Darguments='-Dtycho.disableP2Mirrors=false' \
-D tycho.disableP2Mirrors=false -U \
-D repoToken=${{ secrets.GITHUB_TOKEN }} \
clean install jacoco:report \
coveralls:report \
--no-transfer-progress \
-P $PROFILES
cd ..
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
CI_PULL_REQUEST: ${{ steps.refs.outputs.pr_number }}
- name: Updating wollok-cli & wollok-site
if: github.ref == 'refs/heads/master'
run: |
cd ./scripts
cp ./ssh_config ~/.ssh/config
chmod 777 ./updateRestOfWollokRepos.sh
"./updateRestOfWollokRepos.sh"
cd ..
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_RUN_ID: $GITHUB_RUN_ID
- name: Releasing Latest Development Version
if: github.ref == 'refs/heads/dev'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
**/wollok-linux*64.zip
**/wollok-macosx*64.zip
**/wollok-win32*64.zip
- name: Product Release
uses: "marvinpinto/action-automatic-releases@latest"
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
**/wollok-linux*64.zip
**/wollok-macosx*64.zip
**/wollok-win32*64.zip
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ scripts/wollok-cli

# Ignoring wollok-language files
org.uqbar.project.wollok.lib/src/wollok/*.wlk

# Ignoring settings.xml just because it should be decrypted
settings.xml

# Ignoring private & public keys
wollokcli_rsa
wollokcli_rsa.pub
wolloksite_rsa
wolloksite_rsa.pub

6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ script:
- echo "Running with UPDATE_SITE $UPDATE_SITE"
- export MAVEN_OPTS=-Xmx2048m
- mvn -e -Darguments='-Dtycho.disableP2Mirrors=false' -Dtycho.disableP2Mirrors=false
-U -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean install jacoco:report coveralls:report -P
$PROFILES
-U -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean install
# primera versión: Travis ya no manda reportes de cobertura a Coveralls
# jacoco:report coveralls:report
-P $PROFILES
- rm -rf /home/travis/.m2/repository/org/uqbar-project
- df -h
- du -h -d 2 ..
Expand Down
10 changes: 5 additions & 5 deletions org.uqbar.project.wollok.releng/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,18 @@
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>3.0.1</version>
<version>4.3.0</version>

<configuration>
<!-- <configuration>
<coberturaReports>
<coberturaReport>
${basedir}/target/coverage.xml
</coberturaReport>
</coberturaReports>
<sourceEncoding>UTF-8</sourceEncoding>
<serviceName>travis-ci</serviceName>
<serviceJobId>${env.TRAVIS_JOB_ID} </serviceJobId>
</configuration>
<serviceName>github</serviceName>
<repoToken>${env.COVERALLS_TOKEN}</repoToken>
</configuration> -->
</plugin>
<!-- code coverage -->

Expand Down
4 changes: 2 additions & 2 deletions scripts/ssh_config
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Host wollok_cli
HostName github.com
PreferredAuthentications publickey
IdentityFile /tmp/wollokcli_key
IdentityFile ~/.ssh/wollokcli_key
IdentitiesOnly yes

Host wollok_site
HostName github.com
PreferredAuthentications publickey
IdentityFile /tmp/wolloksite_key
IdentityFile ~/.ssh/wolloksite_key
IdentitiesOnly yes
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
openssl aes-256-cbc -k "$travis_key_password" -d -md sha256 -a -in wolloksite_key.enc -out /tmp/wolloksite_key
openssl aes-256-cbc -k "$travis_key_password" -d -md sha256 -a -in wollokcli_key.enc -out /tmp/wollokcli_key
chmod 600 /tmp/wolloksite_key
chmod 600 /tmp/wollokcli_key
cp ssh_config ~/.ssh/config
eval `ssh-agent -s`

# **************************************************************************************
# WOLLOK-CLI
# **************************************************************************************
echo "****************************************************************************"
echo "Setting github user configuration for wollok-cli"
git config --global user.email "wollokcli@gmail.com"
git config --global user.name "Wollok CLI Bot"

echo "Cloning wollok-cli repo..."
git clone git@wollok_cli:uqbar-project/wollok-cli.git

echo "Updating jars to wollok-cli"
cd ./wollok-cli
./generateCI.sh ../..
Expand All @@ -16,7 +20,32 @@ echo "Copying Wollok library files into libs folder"
mkdir -p ./libs
cp ../org.uqbar.project.wollok.lib/src/wollok/*.wlk ./libs

echo "List of wollok-cli files updated"
cd wollok-cli
echo $GITHUB_RUN_ID > wollok-cli.lastUpdated
git status
echo ""
echo "============================================================================"
echo "Pushing wollok-cli files"
BRANCH_ID=next-version-$GITHUB_RUN_ID
git checkout -b $BRANCH_ID
git add .
git commit -m "Updating Wollok JARs library from Github Action => $GITHUB_RUN_ID"
git push --set-upstream -v origin $BRANCH_ID
gh auth login --hostname wollok_cli
# por el momento no podemos crear PRs porque `gh` no soporta conexión vía SSH
# gh pr create --base master --title "New Wollok Version" --body "Updating Wollok Version - Github Action $GITHUB_RUN_ID"
cd ..

# **************************************************************************************
# WOLLOK-SITE
# **************************************************************************************

echo "****************************************************************************"
echo "Setting github user configuration for wollok-site"
git config --global user.email "wolloksite@gmail.com"
git config --global user.name "Wollok Site Bot"

echo "Cloning Wollok Site repo"
git clone git@wollok_site:uqbar-project/wollok-site.git
rm ./wollok-site/documentacion/wollokdoc/*.html
Expand All @@ -39,31 +68,24 @@ java -cp "./wollok-cli/jars/*" org.uqbar.project.wollok.wollokDoc.WollokDocParse
echo
echo "List of files generated"
ls ./wollok-site/en/documentation/wollokdoc
echo "****************************************************************************"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

echo "List of wollok-cli files updated"
cd wollok-cli
echo $TRAVIS_JOB_ID > wollok-cli.lastUpdated
git status
echo ""
echo "============================================================================"
echo "Pushing wollok-cli files"
git add .
git commit -m "Updating Wollok JARs library from Travis Job $TRAVIS_JOB_ID"
git push -v origin master
echo "****************************************************************************"

# alias ssh='ssh -F <(cat .ssh/config /tmp/wolloksite_key)'
cd ../wollok-site
echo $TRAVIS_JOB_ID > wollok-site.lastUpdated
alias ssh='ssh -F <(cat .ssh/config ~/.ssh/wolloksite_key)'
cd ./wollok-site
echo $GITHUB_RUN_ID > wollok-site.lastUpdated
echo "List of wollok-site files updated"
git status
echo ""
echo "============================================================================"
echo "Pushing wollok-site files"
git checkout -b $BRANCH_ID
git add .
git commit -m "Updating Wollokdoc files from Travis Job $TRAVIS_JOB_ID"
git push -v origin master
git commit -m "Updating Wollokdoc files from Github Action $GITHUB_RUN_ID"
git push --set-upstream -v origin $BRANCH_ID

# por el momento no podemos crear PRs porque `gh` no soporta conexión vía SSH
# gh pr create --base master --title "New Wollok Version" --body "Updating Wollok Version - Github Action $GITHUB_RUN_ID"
cd ..
echo "****************************************************************************"

echo "...done"
Expand Down
Binary file modified scripts/wollokcli_key.enc
Binary file not shown.
Binary file modified scripts/wolloksite_key.enc
Binary file not shown.
Binary file modified settings.xml.enc
Binary file not shown.