diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7fc9d4b..2eac190 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,6 +6,11 @@ jobs: build-and-push: runs-on: ubuntu-latest steps: + - name: Set the value + id: step_one + run: | + echo "APP_VERSION=$(date '+%Y-%m-%d')-$(git rev-parse HEAD | cut -c -6)" >> "$GITHUB_ENV" + - name: Checkout uses: actions/checkout@v3 @@ -28,7 +33,10 @@ jobs: run: docker pull funbiscuit/idea-formatter:latest - name: Build docker image - run: docker build . -t funbiscuit/idea-formatter:latest --cache-from funbiscuit/idea-formatter:latest + run: docker build . -t "funbiscuit/idea-formatter:$APP_VERSION" --cache-from funbiscuit/idea-formatter:latest + + - name: Add latest tag + run: docker tag "funbiscuit/idea-formatter:$APP_VERSION" funbiscuit/idea-formatter:latest - name: Test image run: docker run --rm -v ${{ github.workspace }}:/data funbiscuit/idea-formatter --style CodeStyle.xml --dry --recursive src @@ -41,4 +49,4 @@ jobs: - name: Push docker image if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - run: docker push funbiscuit/idea-formatter:latest + run: docker push "funbiscuit/idea-formatter:$APP_VERSION" && docker push funbiscuit/idea-formatter:latest diff --git a/Dockerfile b/Dockerfile index 2006816..b84d129 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,16 +6,27 @@ RUN apt-get update \ && apt-get install -y unzip wget libfreetype6 fontconfig \ && rm -rf /var/lib/apt/lists/* -RUN wget https://download.jetbrains.com/idea/ideaIC-2023.1.3.tar.gz \ +RUN wget --progress=bar:force https://download.jetbrains.com/idea/ideaIC-2023.1.3.tar.gz \ && tar -xzf ideaIC-2023.1.3.tar.gz \ && rm ideaIC-2023.1.3.tar.gz \ && mv idea-* idea \ && cd idea \ && mv plugins plugins-old \ && mkdir plugins \ - && cp -r plugins-old/java plugins-old/java-ide-customization plugins-old/keymap-* plugins \ + && cp -r plugins-old/java \ + plugins-old/java-ide-customization \ + plugins-old/keymap-* \ + plugins-old/properties \ + plugins-old/Groovy \ + plugins \ && rm -r plugins-old +# PythonCore 231.8770.65 +RUN wget --progress=bar:force -O python-ce.zip "https://plugins.jetbrains.com/plugin/download?rel=true&updateId=326457" \ + && unzip python-ce.zip \ + && rm python-ce.zip \ + && mv python-ce idea/plugins/python-ce + WORKDIR /app/idea COPY build/distributions/formatter-plugin plugins/formatter-plugin