update timelog #26
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
# Runs tests and verifies that the package can be built. | |
name: Build | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
- "dists/**" | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
- "dists/**" | |
# 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: | |
runs-on: ${{matrix.operating-system}} | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ubuntu-22.04, ubuntu-20.04] | |
# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] | |
# 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 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Create GPG key if not exists | |
# gpg --full-generate-key | |
# List to select GPG key | |
# gpg --list-secret-keys --keyid-format=long | |
# Example: rsa3072/7E0EC917A5074BD3 2023-03-13 [SC] [expires: 2025-03-12] | |
# Generate key as base64 | |
# gpg --export-secret-keys 3AA5C34371567BD2 | base64 | |
- name: Dynamically set environment variable | |
run: | | |
sudo timedatectl set-timezone Asia/Ho_Chi_Minh | |
bash ci/environment.sh | |
env: | |
repository: ${{ github.repository }} | |
- name: Retrieve the secret, decode and import GPG key | |
run: | | |
echo "$GPG_KEY====" | tr -d '\n' | fold -w 4 | sed '$ d' | tr -d '\n' | fold -w 76 | base64 -di | gpg --batch --import || true | |
gpg --list-secret-keys --keyid-format=long | |
env: | |
GPG_KEY: ${{ secrets.GPG_KEY }} | |
- name: Configure Git gpg | |
# if: false == true | |
run: | | |
git config commit.gpgsign true | |
git config user.signingkey $GPG_KEY_ID | |
git config --local user.email "$GIT_COMMITTER_EMAIL" | |
git config --local user.name "$GIT_COMMITTER_NAME" | |
git config --local pull.rebase true | |
env: | |
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
GIT_COMMITTER_NAME: ${{ github.repository_owner }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
- name: Installing build dependencies | |
if: false == true | |
run: bash ci/install_build_deps.sh | |
- name: Updating build information | |
if: false == true | |
run: bash ci/update_packages.sh | |
- name: Building package binary | |
if: false == true | |
run: bash ci/build_packages.sh | |
env: | |
BUILDPACKAGE_OPTS: --force-sign | |
BUILDPACKAGE_EPOCH: ${{ env.BUILDPACKAGE_EPOCH }} | |
DEB_SIGN_KEYID: ${{ secrets.GPG_KEY_ID }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
- name: Building package source | |
if: false == true | |
run: bash ci/build_packages.sh | |
env: | |
BUILDPACKAGE_OPTS: --force-sign -S | |
BUILDPACKAGE_EPOCH: ${{ env.BUILDPACKAGE_EPOCH }} | |
DEB_SIGN_KEYID: ${{ secrets.GPG_KEY_ID }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
- name: Move packages to dists | |
if: false == true | |
run: bash ci/move_packages.sh | |
- name: Put package to Personal Package archives | |
if: false == true | |
run: bash ci/put_ppa_packages.sh | |
- name: Push repository | |
if: false == true | |
run: | | |
if [ "$(git status --porcelain=v1 2>/dev/null | wc -l)" != "0" ]; then | |
git add dists/ | |
git add src/debian/changelog | |
git commit -m "Update packages on dists from ${{ matrix.operating-system }} at $(date +'%d-%m-%y')" && | |
# git push https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main || | |
git push || | |
git stash && | |
git pull --rebase && | |
git stash apply && | |
# git push https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main || true | |
git push || true | |
fi |