change on github actions #26
This file contains hidden or 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: Build PCM Linux GTK3 | |
| on: | |
| push: | |
| branches: ["**"] | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| build: | |
| name: Build tar.gz + zip + deb | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Determine version and release info | |
| id: version | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| RELEASE_TAG="v${VERSION}" | |
| IS_PRERELEASE=false | |
| RELEASE_NAME="PCM v${VERSION}" | |
| else | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| VERSION="0.0.0-${SHORT_SHA}" | |
| RELEASE_TAG="dev-${SHORT_SHA}" | |
| IS_PRERELEASE=true | |
| COMMIT_SUBJECT=$(git log -1 --pretty=%s) | |
| RELEASE_NAME="PCM dev ${SHORT_SHA} — ${COMMIT_SUBJECT}" | |
| fi | |
| echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "RELEASE_TAG=${RELEASE_TAG}" >> "$GITHUB_OUTPUT" | |
| echo "IS_PRERELEASE=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT" | |
| echo "RELEASE_NAME=${RELEASE_NAME}" >> "$GITHUB_OUTPUT" | |
| { | |
| echo "COMMIT_BODY<<EOF" | |
| git log -1 --pretty=%B | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| echo "Versione: ${VERSION}" | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends dpkg | |
| - name: Build packages | |
| run: | | |
| bash linuxbuild/build.sh "${{ steps.version.outputs.VERSION }}" --zip --deb | |
| - name: Upload tar.gz | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PCM_v${{ steps.version.outputs.VERSION }}_Linux_GTK3.tar.gz | |
| path: dist/PCM_v${{ steps.version.outputs.VERSION }}_Linux_GTK3.tar.gz | |
| if-no-files-found: error | |
| - name: Upload zip | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PCM_v${{ steps.version.outputs.VERSION }}_Linux_GTK3.zip | |
| path: dist/PCM_v${{ steps.version.outputs.VERSION }}_Linux_GTK3.zip | |
| if-no-files-found: error | |
| - name: Upload deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pcm_${{ steps.version.outputs.VERSION }}_all.deb | |
| path: dist/pcm_${{ steps.version.outputs.VERSION }}_all.deb | |
| if-no-files-found: error | |
| - name: Create GitHub Release | |
| if: github.event_name == 'push' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.RELEASE_TAG }} | |
| name: ${{ steps.version.outputs.RELEASE_NAME }} | |
| body: ${{ steps.version.outputs.COMMIT_BODY }} | |
| draft: false | |
| prerelease: ${{ steps.version.outputs.IS_PRERELEASE }} | |
| files: | | |
| dist/PCM_v${{ steps.version.outputs.VERSION }}_Linux_GTK3.tar.gz | |
| dist/PCM_v${{ steps.version.outputs.VERSION }}_Linux_GTK3.zip | |
| dist/pcm_${{ steps.version.outputs.VERSION }}_all.deb |