name: Update version on: workflow_dispatch: workflow_call: inputs: uploading: type: string secrets: GPG_KEY1: required: true GPG_PASSPHRASE1: required: true GPG_KEY2: required: true GPG_PASSPHRASE2: required: true SCRIPTS_ACCESS_TOKEN: required: true KEY_TORRENTS: required: true KNOWN_HOSTS_UPLOAD: required: true jobs: Update: name: Version runs-on: fast if: ${{ github.repository_owner == 'Armbian' }} steps: - name: Remove previous artefacts if any run: | sudo rm -rf changes 2>/dev/null || true - name: Download changes uses: actions/download-artifact@v3 with: name: changes - name: Check run: | [ -s changes ] || echo "SKIP=yes" >> $GITHUB_ENV - name: Checkout Armbian build script if: ${{ github.repository_owner == 'Armbian' && env.SKIP != 'yes' }} uses: actions/checkout@v3.1.0 with: fetch-depth: 0 repository: armbian/build path: build ref: nightly clean: false - name: Checkout Armbian support scripts if: ${{ github.repository_owner == 'Armbian' && env.SKIP != 'yes' }} uses: actions/checkout@v3.1.0 with: fetch-depth: 0 repository: armbian/scripts path: scripts clean: false - name: Import GPG key if: ${{ github.repository_owner == 'Armbian' && env.SKIP != 'yes' }} uses: crazy-max/ghaction-import-gpg@v5 with: gpg_private_key: ${{ secrets.GPG_KEY2 }} passphrase: ${{ secrets.GPG_PASSPHRASE2 }} workdir: build git_user_signingkey: true git_commit_gpgsign: true - name: Bump version if: ${{ github.repository_owner == 'Armbian' && env.SKIP != 'yes' }} run: | cd build git symbolic-ref --short -q HEAD if [[ "$(git symbolic-ref --short -q HEAD)" == nightly ]]; then CURRENT_VERSION=$(cat VERSION) NEW_VERSION="${CURRENT_VERSION%%-trunk}" if [[ "$CURRENT_VERSION" == *trunk* ]]; then VALUE=$(echo $NEW_VERSION | cut -d"." -f4 | sed 's/^0*//') NEW_VERSION=$(echo "${CURRENT_VERSION}" | cut -d. -f1-3)"."$(printf "%04d\n" $((${VALUE} + 1))) else NEW_VERSION=$(echo "${CURRENT_VERSION}" | cut -d. -f1-2)"."$((${NEW_VERSION##*.} + 1)) fi sudo git checkout -f sudo chown -R $USER:$USER .git git pull echo "${NEW_VERSION}" > VERSION git config --global user.email "info@armbian.com" git config --global user.name "Armbianworker" git add VERSION git commit -m "Bumping to new version" -m "" -m "Adding following kernels:" \ -m "$(find output/debs-beta/ -type f -name "linux-image*${CURRENT_VERSION}*.deb" -printf "%f\n" | sort)" git push fi