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

Create all packages on release #683

Merged
merged 14 commits into from
Dec 10, 2020
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This sets the environment for building Kiwix JS store packages and runs the build script

name: Build all packages on release publish

# Controls when the action will run.
on:
# Triggers the workflow on release publish
release:
types: [ published ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Decrypt the ssh secret
- name: Decrypt files
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
MOZILLA_API_SECRET: ${{ secrets.MOZILLA_API_SECRET }}
MOZILLA_API_KEY: ${{ secrets.MOZILLA_API_KEY }}
GHWS: ${{ github.workspace }}
# We use version 0.0.0 for testing this script, becuase github.event.release.tag_name
# only exists if the release event has fired
TAG_NAME: ${{ github.event.release.tag_name }} || "0.0.0"
run: |
echo "$SSH_KEY" | base64 -d > ./$GHWS/scripts/ssh_key
chmod 600 ./$GHWS/scripts/ssh_key

# Set up the environment
- name: Setup environment
run: sudo apt-get --yes install ./$GHWS/ubuntu_touch/*.deb

# Runs the build scripts
- name: Run the build scripts
# Switch -t indicates a tag release; -d indicates dry run (for testing)
run: sh DISPLAY=:99.0 ./$GHWS/scripts/create_all_packages.sh -t -v $TAG_NAME -d
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ www-ghdeploy
/scripts/set_secret_environment_variables.sh
/build/
/scripts/travisci_builder_id_key
/scripts/ssh_key
/scripts/secret_files.tar.gz

#Visual Studio
Expand Down
4 changes: 2 additions & 2 deletions scripts/create_all_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ if [ "${DRYRUN}zz" == "zz" ]; then
CURRENT_DATE=$(date +'%Y-%m-%d')
# Upload the files on download.kiwix.org
echo "Uploading the files on https://download.kiwix.org/nightly/$CURRENT_DATE/"
ssh -i scripts/travisci_builder_id_key [email protected] mkdir -p /data/download/nightly/$CURRENT_DATE
scp -r -p -i scripts/travisci_builder_id_key build/* [email protected]:/data/download/nightly/$CURRENT_DATE
ssh -i ssh_key [email protected] mkdir -p /data/download/nightly/$CURRENT_DATE
scp -r -p -i ssh_key build/* [email protected]:/data/download/nightly/$CURRENT_DATE
else
echo "Skipping uploading the files, because it's a dryrun test"
fi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.