Skip to content

Update workflows to use "concurrency" GHA functionality to skip redun… #114

Update workflows to use "concurrency" GHA functionality to skip redun…

Update workflows to use "concurrency" GHA functionality to skip redun… #114

Workflow file for this run

name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Install tools
run: |
sudo apt-get install moreutils
- name: Install dependencies
run: |
make dev-install-dependencies-pack
make dev-install-dependencies-pack-sudo
make dev-install-dependencies-for-development
- name: Export current snapshot of app
run: echo "SDLAPP_VERSION_CURRENT_SNAPSHOT=$(jq -r '.meta.version' globalConfig.json)" >> $GITHUB_ENV
- name: Export release version of app
run: echo "SDLAPP_VERSION_RELEASE=`echo '${{ env.SDLAPP_VERSION_CURRENT_SNAPSHOT }}' | sed -En 's/-SNAPSHOT//p'`" >> $GITHUB_ENV
- name: Export new snapshot of app
run: echo "SDLAPP_VERSION_NEW_SNAPSHOT=`awk -vFS=. -vOFS=. '{$NF++;print}' <<<'${{ env.SDLAPP_VERSION_RELEASE }}'`-SNAPSHOT" >> $GITHUB_ENV
- name: Delete previous releases
run: rm -rf release
- name: Remove old releases
run: |
git config user.email "[email protected]"
git config user.name "github-actions[bot]"
git rm -r --cached release
git commit -m "chore: remove old releases"
git push
- name: Build release
run: |
scripts/pack.sh \
--version "${{ env.SDLAPP_VERSION_RELEASE }}" \
--input TA_dataset \
--output output \
--release release
- name: Prepare next snapshot
run: |
jq ".meta.version=\"${{ env.SDLAPP_VERSION_NEW_SNAPSHOT }}\"" globalConfig.json | sponge globalConfig.json
jq ".info.id.version=\"${{ env.SDLAPP_VERSION_NEW_SNAPSHOT }}\"" TA_dataset/app.manifest | sponge TA_dataset/app.manifest
crudini --set TA_dataset/default/app.conf launcher version ${{ env.SDLAPP_VERSION_NEW_SNAPSHOT }}
crudini --set TA_dataset/default/app.conf id version ${{ env.SDLAPP_VERSION_NEW_SNAPSHOT }}
sed -i 's/${{ env.SDLAPP_VERSION_CURRENT_SNAPSHOT }}/${{ env.SDLAPP_VERSION_NEW_SNAPSHOT }}/' README.md
pre-commit run --files globalConfig.json TA_dataset/app.manifest TA_dataset/default/app.conf README.md
- name: Commit version changes
uses: test-room-7/action-update-file@v1
id: commit_step
with:
file-path: |
globalConfig.json
TA_dataset/app.manifest
TA_dataset/default/app.conf
release/TA_dataset-${{ env.SDLAPP_VERSION_RELEASE }}.tar.gz
commit-msg: Release version ${{ env.SDLAPP_VERSION_RELEASE }} and prepare next development version
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Push tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.SDLAPP_VERSION_RELEASE }}
default_bump: false
commit_sha: ${{steps.commit_step.outputs.commit-sha}}