eldono-de-la-tago #1769
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
name: eldono-de-la-tago | |
# Ĉiutaga eldono kompilas la retpaĝojn kaj sqlite-datumbazon el aktualaj fontoj | |
# Ĝi enhavas html-paĝojn, xml-fontojn, sqlite3-datumbazon, | |
# vd ĉe https://github.com/revuloj/revo-fonto/releases | |
on: | |
schedule: | |
# ĉiutage matene | |
# * estas speciala signo, do nepre uzu citilojn | |
- cron: '15 8 * * *' | |
#- cron: '34 19 * * 2' | |
env: | |
# eldono de voko-formiko: {latest|stabila|2x} | |
IMAGE_TAG: 2l | |
GIT_REPO_REVO: https://github.com/revuloj/revo-fonto.git | |
# agoj (gh-actions) | |
# https://github.com/softprops/action-gh-release | |
# https://github.com/actions/github-script | |
# https://help.github.com/en/actions/reference/development-tools-for-github-actions | |
jobs: | |
eldono: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Hodiaŭ..." | |
run: | | |
Tagoj=(Dimanĉo Lundo Mardo Merkredo Ĵaudo Vendredo Sabato) | |
echo "TAGO=${Tagoj[ $(date +'%w') ]}" >> $GITHUB_ENV | |
- name: "Eĥo..." | |
run: | | |
echo $TAGO | |
- uses: actions/github-script@v7 | |
name: Movu etikedon al la nuna kap-pozicio | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
var result = {}; | |
const ref = await github.rest.git.getRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'heads/master'}) | |
const sha = ref.data.object.sha; | |
console.log('HEAD is: '+sha); | |
try { | |
result = await github.rest.git.updateRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: sha, | |
ref: 'tags/v${{ env.TAGO }}', | |
force: true }) | |
} catch(error) { | |
console.log("ERROR:"); | |
console.log(error); | |
result = await github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: sha, | |
ref: 'refs/tags/v${{ env.TAGO }}' | |
}) | |
} | |
console.log("RESULT...") | |
console.log(result) | |
- uses: actions/github-script@v7 | |
name: Forigu malnovan eldonon de tiu tago | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
try { | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: 'v${{ env.TAGO }}' }) | |
const release_id = release.data.id | |
console.log('Release id is: '+release_id) | |
const result = await github.rest.repos.deleteRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: release_id }) | |
console.log("RESULT...") | |
console.log(result) | |
} catch(error) { | |
console.log("ERROR:") | |
console.log(error) | |
} | |
#### | |
#' | |
- name: Rekreu eldonon kun sama etikedo (semajntago) | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.TAGO }} | |
name: Eldono de ${{ env.TAGO }} | |
draft: false | |
prerelease: false | |
datumbazo: | |
needs: eldono | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Hodiaŭ..." | |
run: | | |
Tagoj=(Dimanĉo Lundo Mardo Merkredo Ĵaudo Vendredo Sabato) | |
echo "TAGO=${Tagoj[ $(date +'%w') ]}" >> $GITHUB_ENV | |
- name: Eltrovu la URL de la hodiaŭa eldono | |
uses: actions/github-script@v7 | |
id: retrieve_release | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: 'v${{ env.TAGO }}' | |
}) | |
const upload_url = release.data.upload_url | |
console.log('UploadURL is: '+upload_url) | |
core.setOutput('upload_url',upload_url) | |
##' | |
## const core = require('@actions/core') | |
## core.setOutput('upload_url', upload_url) | |
- name: Elŝutu la dosierojn | |
uses: actions/checkout@v4 | |
- name: Saluto al ghcr.io | |
# https://git.luolix.topmunity/t5/GitHub-Actions/Use-docker-images-from-GitHub-Package-Registry/td-p/30407 | |
# https://github.com/actions/starter-workflows/blob/master/ci/docker-push.yml | |
run: echo "$GITHUB_TOKEN" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Prenu procesumon voko-formiko | |
run: docker pull "ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }}" | |
- name: Kreu dosierujojn por konservi la rezultojn ... | |
run: | | |
mkdir $GITHUB_WORKSPACE/tgz | |
#mkdir $GITHUB_WORKSPACE/tmp | |
chmod 777 $GITHUB_WORKSPACE/t?? | |
ls -l $GITHUB_WORKSPACE | |
- name: Kreu SQLite-datumbazon el la XML-dosieroj | |
run: docker run --name voko-formiko | |
-v $GITHUB_WORKSPACE/revo:/home/formiko/revo/xml | |
-v $GITHUB_WORKSPACE/tgz:/home/formiko/tgz | |
ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }} | |
formiko srv-sqlite-db-tuto | |
# vd. https://github.com/actions/upload-release-asset | |
- name: Retrovu la rezultintajn ZIP-dosierojn | |
id: retrovu_zip | |
run: | | |
ls -l $GITHUB_WORKSPACE/tgz | |
echo "revosql=$(basename -- tgz/revosql_20*)" >> $GITHUB_OUTPUT | |
echo "revosql_inx=$(basename -- tgz/revosql-inx_20*)" >> $GITHUB_OUTPUT | |
- name: Alpendigu sqlrevo-inx | |
id: upload-inx | |
uses: maexled/upload-release-assets@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.retrieve_release.outputs.upload_url }} | |
asset_path: tgz/${{ steps.retrovu_zip.outputs.revosql_inx }} | |
asset_name: ${{ steps.retrovu_zip.outputs.revosql_inx }} | |
asset_content_type: application/zip | |
- name: Alpendigu sqlrevo | |
id: upload-inx-art | |
uses: maexled/upload-release-assets@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.retrieve_release.outputs.upload_url }} | |
asset_path: tgz/${{ steps.retrovu_zip.outputs.revosql }} | |
asset_name: ${{ steps.retrovu_zip.outputs.revosql }} | |
asset_content_type: application/zip | |
xdxf: | |
needs: eldono | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Hodiaŭ..." | |
run: | | |
Tagoj=(Dimanĉo Lundo Mardo Merkredo Ĵaudo Vendredo Sabato) | |
echo "TAGO=${Tagoj[ $(date +'%w') ]}" >> $GITHUB_ENV | |
- name: Eltrovu la URL de la hodiaŭa eldono | |
uses: actions/github-script@v7 | |
id: retrieve_release | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: 'v${{ env.TAGO }}' | |
}) | |
const upload_url = release.data.upload_url | |
console.log('UploadURL is: '+upload_url) | |
core.setOutput('upload_url',upload_url) | |
##' | |
## const core = require('@actions/core') | |
## core.setOutput('upload_url', upload_url) | |
- name: Elŝutu la dosierojn | |
uses: actions/checkout@v4 | |
- name: Saluto al ghcr.io | |
# https://git.luolix.topmunity/t5/GitHub-Actions/Use-docker-images-from-GitHub-Package-Registry/td-p/30407 | |
# https://github.com/actions/starter-workflows/blob/master/ci/docker-push.yml | |
run: echo "$GITHUB_TOKEN" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Prenu procesumon voko-formiko | |
run: docker pull "ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }}" | |
- name: Kreu dosierujojn por konservi la rezultojn ... | |
run: | | |
mkdir $GITHUB_WORKSPACE/tgz | |
#mkdir $GITHUB_WORKSPACE/tmp | |
chmod 777 $GITHUB_WORKSPACE/t?? | |
ls -l $GITHUB_WORKSPACE | |
- name: Kreu XDXF-dosieron el la XML-dosieroj | |
run: docker run --name voko-formiko | |
-v $GITHUB_WORKSPACE/revo:/home/formiko/revo/xml | |
-v $GITHUB_WORKSPACE/tgz:/home/formiko/tgz | |
ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }} | |
formiko dict-xdxf-zip | |
# vd. https://github.com/actions/upload-release-asset | |
- name: Retrovu la rezultintajn ZIP-dosieron | |
id: retrovu_zip | |
run: | | |
ls -l $GITHUB_WORKSPACE/tgz | |
echo "revoxdxf=$(basename -- tgz/revoxdxf_20*.zip)" >> $GITHUB_OUTPUT | |
- name: Alpendigu xdxf | |
id: upload-xdxf | |
uses: maexled/upload-release-assets@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.retrieve_release.outputs.upload_url }} | |
asset_path: tgz/${{ steps.retrovu_zip.outputs.revoxdxf }} | |
asset_name: ${{ steps.retrovu_zip.outputs.revoxdxf }} | |
asset_content_type: application/zip | |
revo-med-inx-tez: | |
needs: eldono | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Hodiaŭ..." | |
run: | | |
Tagoj=(Dimanĉo Lundo Mardo Merkredo Ĵaudo Vendredo Sabato) | |
echo "TAGO=${Tagoj[ $(date +'%w') ]}" >> $GITHUB_ENV | |
- uses: actions/github-script@v7 | |
name: Eltrovu la nunan pozicion (kapo) | |
id: trovu_kapon | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const ref = await github.rest.git.getRef({...context.repo, ref: 'heads/master'}) | |
const sha = ref.data.object.sha | |
console.log('heads/master estas ĉe: '+sha) | |
core.setOutput('sha_hm',sha) | |
# https://git.luolix.topmunity/t5/GitHub-Actions/Use-docker-images-from-GitHub-Package-Registry/td-p/30407 | |
# https://github.com/actions/starter-workflows/blob/master/ci/docker-push.yml | |
- name: Saluto al ghcr.io kaj preni voko-formiko | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
echo "$GITHUB_TOKEN" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker pull "ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }}" | |
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | |
- name: Kreu dosierujojn por konservi la rezultojn ... | |
run: | | |
mkdir .tgz | |
mkdir .log | |
- name: Kreu la med,inx,tez | |
run: docker run -u1001 | |
-e GIT_REPO_REVO=${{ env.GIT_REPO_REVO }} | |
-v $GITHUB_WORKSPACE/.tgz:/home/formiko/tgz | |
-v $GITHUB_WORKSPACE/.log:/home/formiko/log | |
ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }} formiko | |
-Dsha=${{ steps.trovu_kapon.outputs.sha_hm }} | |
srv-servo-github-medinxtez | |
- name: Rigardu la rezulton | |
run: | | |
#tar -czf revo.tgz $GITHUB_WORKSPACE/revo | |
ls -l .tgz/ .log/ | |
- name: Eltrovu la URL de la hodiaŭa eldono | |
uses: actions/github-script@v7 | |
id: retrieve_release | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: 'v${{ env.TAGO }}' | |
}) | |
const upload_url = release.data.upload_url | |
console.log('UploadURL is: '+upload_url) | |
core.setOutput('upload_url',upload_url) | |
- name: Retrovu la rezultintan ZIP-dosierujon | |
id: revo_zip | |
run: | | |
ls -l $GITHUB_WORKSPACE/.tgz | |
echo "revohtml=$(basename -- .tgz/revohtml_20*)" >> $GITHUB_OUTPUT | |
- name: Alpendigu revo-zip al la hodiaŭa eldono | |
id: upload-zip | |
uses: maexled/upload-release-assets@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.retrieve_release.outputs.upload_url }} | |
asset_path: .tgz/${{ steps.revo_zip.outputs.revohtml }} | |
asset_name: ${{ steps.revo_zip.outputs.revohtml }} | |
asset_content_type: application/zip | |
revo-art: | |
needs: eldono | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Hodiaŭ..." | |
run: | | |
Tagoj=(Dimanĉo Lundo Mardo Merkredo Ĵaudo Vendredo Sabato) | |
echo "TAGO=${Tagoj[ $(date +'%w') ]}" >> $GITHUB_ENV | |
- uses: actions/github-script@v7 | |
name: Eltrovu la nunan pozicion (kapo) | |
id: trovu_kapon | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const ref = await github.rest.git.getRef({...context.repo, ref: 'heads/master'}) | |
const sha = ref.data.object.sha | |
console.log('heads/master estas ĉe: '+sha) | |
core.setOutput('sha_hm',sha) | |
# https://git.luolix.topmunity/t5/GitHub-Actions/Use-docker-images-from-GitHub-Package-Registry/td-p/30407 | |
# https://github.com/actions/starter-workflows/blob/master/ci/docker-push.yml | |
- name: Saluto al ghcr.io kaj preni voko-formiko | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
echo "$GITHUB_TOKEN" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker pull "ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }}" | |
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | |
- name: Kreu dosierujojn por konservi la rezultojn ... | |
run: | | |
mkdir .tgz | |
mkdir .log | |
- name: Kreu la artikolojn | |
run: docker run -u1001 | |
-e GIT_REPO_REVO=${{ env.GIT_REPO_REVO }} | |
-v $GITHUB_WORKSPACE/.tgz:/home/formiko/tgz | |
-v $GITHUB_WORKSPACE/.log:/home/formiko/log | |
ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }} formiko | |
-Dsha=${{ steps.trovu_kapon.outputs.sha_hm }} | |
srv-servo-github-art | |
- name: Rigardu la rezulton | |
run: | | |
#tar -czf revo.tgz $GITHUB_WORKSPACE/revo | |
ls -l .tgz/ .log/ | |
- name: Eltrovu la URL de la hodiaŭa eldono | |
uses: actions/github-script@v7 | |
id: retrieve_release | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: 'v${{ env.TAGO }}' | |
}) | |
const upload_url = release.data.upload_url | |
console.log('UploadURL is: '+upload_url) | |
core.setOutput('upload_url',upload_url) | |
- name: Retrovu la rezultintan ZIP-dosierujon | |
id: revo_zip | |
run: | | |
ls -l $GITHUB_WORKSPACE/.tgz | |
echo "revohtml=$(basename -- .tgz/revoart_20*)" >> $GITHUB_OUTPUT | |
- name: Alpendigu revo-zip al la hodiaŭa eldono | |
id: upload-zip | |
uses: maexled/upload-release-assets@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.retrieve_release.outputs.upload_url }} | |
asset_path: .tgz/${{ steps.revo_zip.outputs.revohtml }} | |
asset_name: ${{ steps.revo_zip.outputs.revohtml }} | |
asset_content_type: application/zip | |
revo-hst: | |
needs: eldono | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Hodiaŭ..." | |
run: | | |
Tagoj=(Dimanĉo Lundo Mardo Merkredo Ĵaudo Vendredo Sabato) | |
echo "TAGO=${Tagoj[ $(date +'%w') ]}" >> $GITHUB_ENV | |
- uses: actions/github-script@v7 | |
name: Eltrovu la nunan pozicion (kapo) | |
id: trovu_kapon | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const ref = await github.rest.git.getRef({...context.repo, ref: 'heads/master'}) | |
const sha = ref.data.object.sha | |
console.log('heads/master estas ĉe: '+sha) | |
core.setOutput('sha_hm',sha) | |
# https://git.luolix.topmunity/t5/GitHub-Actions/Use-docker-images-from-GitHub-Package-Registry/td-p/30407 | |
# https://github.com/actions/starter-workflows/blob/master/ci/docker-push.yml | |
- name: Saluto al ghcr.io kaj preni voko-formiko | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
echo "$GITHUB_TOKEN" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker pull "ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }}" | |
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | |
- name: Kreu dosierujojn por konservi la rezultojn ... | |
run: | | |
mkdir .tgz | |
mkdir .log | |
- name: Kreu la historiojn | |
run: docker run -u1001 | |
-e GIT_REPO_REVO=${{ env.GIT_REPO_REVO }} | |
-v $GITHUB_WORKSPACE/.tgz:/home/formiko/tgz | |
-v $GITHUB_WORKSPACE/.log:/home/formiko/log | |
ghcr.io/revuloj/voko-formiko/voko-formiko:${{ env.IMAGE_TAG }} formiko | |
-Dsha=${{ steps.trovu_kapon.outputs.sha_hm }} | |
srv-servo-github-hst | |
- name: Rigardu la rezulton | |
run: | | |
#tar -czf revo.tgz $GITHUB_WORKSPACE/revo | |
ls -l .tgz/ .log/ | |
- name: Eltrovu la URL de la hodiaŭa eldono | |
uses: actions/github-script@v7 | |
id: retrieve_release | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
debug: true | |
script: | | |
const release = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: 'v${{ env.TAGO }}' | |
}) | |
const upload_url = release.data.upload_url | |
console.log('UploadURL is: '+upload_url) | |
core.setOutput('upload_url',upload_url) | |
- name: Retrovu la rezultintan ZIP-dosierujon | |
id: revo_zip | |
run: | | |
ls -l $GITHUB_WORKSPACE/.tgz | |
echo "revohtml=$(basename -- .tgz/revohst_20*)" >> $GITHUB_OUTPUT | |
- name: Alpendigu revo-zip al la hodiaŭa eldono | |
id: upload-zip | |
uses: maexled/upload-release-assets@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.retrieve_release.outputs.upload_url }} | |
asset_path: .tgz/${{ steps.revo_zip.outputs.revohtml }} | |
asset_name: ${{ steps.revo_zip.outputs.revohtml }} | |
asset_content_type: application/zip | |