From 3c1041e897e855b2b928c65e8f774b6d7f6f44f6 Mon Sep 17 00:00:00 2001 From: galargh Date: Mon, 13 Mar 2023 08:42:04 +0100 Subject: [PATCH] Initial release --- .github/workflows/docker.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ CHANGELOG.md | 9 +++++++++ Dockerfile | 18 ++++++++++++++++++ README.md | 15 +++++++++++++++ action.yml | 17 +++++++++++++++++ 6 files changed, 121 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 action.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..969299b --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,34 @@ +name: Docker +on: + push: + tags: + - '*' + workflow_dispatch: + inputs: + tag: + description: 'Tag' + required: true + default: 'latest' +jobs: + docker: + name: Docker + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag || github.event.ref_name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cb067fb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release +on: + push: + paths: [CHANGELOG.md] + branches: [main] + pull_request: + paths: [CHANGELOG.md] + branches: [main] +jobs: + release: + name: Realase + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - id: release + uses: pl-strflt/changelog-driven-release@v1 + with: + path: CHANGELOG.md + draft: ${{ github.event_name == 'pull_request' }} + - if: github.event_name == 'pull_request' && steps.release.outputs.tag != '' + uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd # v2.5.0 + with: + header: release + recreate: true + message: | + ## [${{ steps.release.outputs.tag }}](${{ steps.release.outputs.url }}) + + ${{ steps.release.outputs.body }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7fba332 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased +### Added +- Initial release diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0f8ed7f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM eclipse-temurin:11 + +ARG SAXON_HE_REPOSITORY=pl-strflt/Saxon-HE +ARG SAXON_HE_SHA=392d705f7d603b0cfdd4c95fddd3c0a80590a21b + +ARG ANT_REPOSITORY=pl-strflt/ant +ARG ANT_SHA=06666b51cd07442d1f20547853f03a28f61207fd + +RUN apt-get update && apt-get install -y unzip jq + +RUN curl -L --max-redirs 5 --retry 5 --no-progress-meter --output "SaxonHE11-5J.zip" "https://raw.githubusercontent.com/${SAXON_HE_REPOSITORY}/${SAXON_HE_SHA}/11/Java/SaxonHE11-5J.zip" && \ + unzip "SaxonHE11-5J.zip" -d "/opt/SaxonHE11-5J" && \ + rm "SaxonHE11-5J.zip" +RUN for file in gotest.xsl junit-frames-saxon.xsl junit-noframes-saxon.xsl; do \ + curl -L --max-redirs 5 --retry 5 --no-progress-meter --output "/etc/${file}" "https://raw.githubusercontent.com/${ANT_REPOSITORY}/${ANT_SHA}/src/etc/${file}"; \ + done + +ENTRYPOINT ["java", "-jar", "/opt/SaxonHE11-5J/saxon-he-11.5.jar"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..6cac1a4 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Saxon + +Saxon is a GitHub Action that runs the latest stable Saxon-HE distribution. It comes prepopulated with some ant XSL templates. + +## Inputs + +* `args`: Arguments to pass to the Saxon-HE command. + +## Example Usage + +See [junit-xml-to-html](https://github.com/pl-strflt/junit-xml-to-html/blob/main/action.yml) for an example of how to use this action. + +The action is also distributed as a docker image at https://github.com/orgs/pl-strflt/packages/container/package/saxon + +--- diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..6c11ea9 --- /dev/null +++ b/action.yml @@ -0,0 +1,17 @@ +# action.yml +name: 'Saxon' +description: 'Runs Saxon-HE' +inputs: + args: + description: 'Arguments to pass to the Saxon-HE command' + required: false +runs: + using: 'composite' + steps: + - id: github + uses: pl-strflt/docker-container-action/.github/actions/github@v1 + - uses: pl-strflt/docker-container-action@v1 + with: + repository: ${{ steps.github.outputs.action_repository }} + ref: ${{ steps.github.outputs.action_ref }} + args: ${{ inputs.args }}