From c4cb44131e78170e3d8a4283b042a7eecb6a8207 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 18 Jan 2023 22:32:17 +0000 Subject: [PATCH 1/4] Update README links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4eacf23..629866f 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ The canonical version of this repository is [on GitHub][GitHub repo]. Releases Please [contact the Cygwin mailing list][Cygwin lists] in the first instance with any issues / questions / thoughts / &c. -[AsciiDoc]: https://asciidoc.org/ +[AsciiDoc]: https://asciidoc-py.github.io/ [Cygwin]: https://www.cygwin.com/ [Cygwin lists]: https://cygwin.com/lists.html -[GitHub repo]: https://github.com/me-and/Cygwin-AsciiDoc +[GitHub repo]: https://github.com/cygporter/AsciiDoc [Cygwin repo]: https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/asciidoc.git From a70754bda04cc6ed64a37793dfcd0adc570b19a7 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 18 Jan 2023 22:35:34 +0000 Subject: [PATCH 2/4] Switch to using cygporter workflows --- .github/workflows/build-test-release.yml | 27 ++++++ .github/workflows/ci.yml | 115 ----------------------- .github/workflows/prepare-release.yml | 23 +++++ .github/workflows/release.yml | 16 ++++ 4 files changed, 66 insertions(+), 115 deletions(-) create mode 100644 .github/workflows/build-test-release.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/prepare-release.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml new file mode 100644 index 0000000..a811584 --- /dev/null +++ b/.github/workflows/build-test-release.yml @@ -0,0 +1,27 @@ +name: Build, test, release +on: [push, pull_request] +jobs: + build-test: + uses: cygporter/workflows/.github/workflows/build-test.yml@v1 + with: + cygport_file: asciidoc.cygport + + prep-release: + if: startsWith(github.ref, join(fromJSON('["refs/heads/v", "${{ needs.build-test.outputs.pv }}"]'), '')) + needs: build-test + permissions: + contents: write + uses: cygporter/workflows/.github/workflows/prep-release.yml@v1 + with: + cygport_file: asciidoc.cygport + publish: true + + release: + if: startsWith(github.ref, join(fromJSON('["refs/heads/v", "${{ needs.build-test.outputs.pv }}"]'), '')) + needs: [build-test, prep-release] + uses: cygporter/workflows/.github/workflows/release.yml@v1 + with: + cygport_file: asciidoc.cygport + tag_name: ${{ needs.prep-release.outputs.release_tag }} + secrets: + maintainer_key: ${{ secrets.maintainer_key }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4eb7b9b..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: CI -on: [push, pull_request] -jobs: - ci: - runs-on: windows-latest - defaults: - run: - shell: bash --noprofile --norc -e -o pipefail -o igncr {0} - env: - PATH: C:\cygwin\bin - steps: - - name: Install Cygwin Git - uses: cygwin/cygwin-install-action@ad81540ad7c2726e17c08401fbeca6380cc7f463 - with: - packages: git - timeout-minutes: 10 - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - timeout-minutes: 1 - - name: Load packages to install - id: cyg-package-list - run: | - printf '::set-output name=packages::' - tr '\n' ' ' /var/log/cygcheck.out - timeout-minutes: 5 - - name: Store Cygwin logs - if: always() - uses: actions/upload-artifact@v2 - with: - name: cygwin-logs - path: 'C:\cygwin\var\log\' - timeout-minutes: 5 - - name: Cygport download - run: cygport asciidoc.cygport download - timeout-minutes: 5 - - name: Cygport prep - run: cygport asciidoc.cygport prep - timeout-minutes: 1 - - name: Cygport compile - run: cygport asciidoc.cygport compile - timeout-minutes: 5 - - name: Cygport test - run: cygport asciidoc.cygport test - timeout-minutes: 5 - - name: Cygport install - run: cygport asciidoc.cygport install - timeout-minutes: 5 - - name: Cygport package - run: cygport asciidoc.cygport package - timeout-minutes: 5 - - name: Configure SSH - if: github.ref == 'refs/heads/main' - env: - MAINTAINER_KEY: ${{ secrets.MAINTAINER_KEY }} - run: | - umask 0077 - mkdir -p ~/.ssh - echo "$MAINTAINER_KEY" >~/.ssh/id_rsa - echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts - timeout-minutes: 1 - - name: Compute release name - if: github.ref == 'refs/heads/main' - id: release-name - run: | - eval $(grep -e '^VERSION=' -e '^RELEASE=' asciidoc.cygport) - printf '::set-output name=release::v%s-%s' "$VERSION" "$RELEASE" - timeout-minutes: 1 - - name: Create release tag - if: github.ref == 'refs/heads/main' - env: - GIT_COMMITTER_NAME: ${{ github.actor }} - GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com - run: | - git tag -am '${{ steps.release-name.outputs.release }}' '${{ steps.release-name.outputs.release }}' - git push origin tag '${{ steps.release-name.outputs.release }}' - timeout-minutes: 1 - - name: Create a GitHub release - if: github.ref == 'refs/heads/main' - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ steps.release-name.outputs.release }} - files: asciidoc-*/dist/asciidoc/* - target_commitish: ${{ github.ref }} - timeout-minutes: 2 - - name: Mirror to Cygwin Git repositories - if: github.ref == 'refs/heads/main' - run: git push cygwin@cygwin.com:/git/cygwin-packages/asciidoc '${{ steps.release-name.outputs.release }}' - timeout-minutes: 5 - - name: Cygport upload - if: github.ref == 'refs/heads/main' - run: SSH_KEY=~/.ssh/id_rsa cygport asciidoc.cygport upload - timeout-minutes: 5 - - name: Tar up build results - if: always() - run: tar -caf asciidoc.txz asciidoc-*-*.*/ - timeout-minutes: 10 - - name: Store build results - if: always() - uses: actions/upload-artifact@v2 - with: - name: build-results - path: asciidoc.txz - if-no-files-found: error - timeout-minutes: 5 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..915004f --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,23 @@ +name: Prepare release +on: + workflow_dispatch: + inputs: + release_tag: + description: Name for the release tag + required: false + default: '' + type: string + publish: + description: Whether to publish the release + required: false + default: false + type: boolean +permissions: + contents: write +jobs: + prep-release: + uses: cygporter/workflows/.github/workflows/prep-release.yml@v1 + with: + cygport_file: asciidoc.cygport + release_tag: ${{ inputs.release_tag }} + publish: ${{ inputs.publish }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..84c2801 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,16 @@ +name: Release +on: + workflow_dispatch: + inputs: + release_tag: + description: Name of the release tag + required: true + type: string +jobs: + release: + uses: cygporter/workflows/.github/workflows/release.yml@v1 + with: + cygport_file: asciidoc.cygport + tag_name: ${{ inputs.release_tag }} + secrets: + maintainer_key: ${{ secrets.maintainer_key }} From 5fd34fbe1c4905811e0b997be31ec2ed1d35fe87 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 18 Jan 2023 23:38:07 +0000 Subject: [PATCH 3/4] Install python3, re-wrangle dependency files Install Python3 as well as cygport, as it's needed to parse the cygport file. Also split up the workflow files to add more nesting and reduce repetition. --- .github/workflows/build-test-release.yml | 12 ++++-------- .github/workflows/build.yml | 10 ++++++++++ .github/workflows/prepare-release.yml | 13 +++++++++++++ .github/workflows/release.yml | 12 ++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index a811584..fb6fe4e 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -2,26 +2,22 @@ name: Build, test, release on: [push, pull_request] jobs: build-test: - uses: cygporter/workflows/.github/workflows/build-test.yml@v1 - with: - cygport_file: asciidoc.cygport + uses: ./.github/workflows/build.yml prep-release: if: startsWith(github.ref, join(fromJSON('["refs/heads/v", "${{ needs.build-test.outputs.pv }}"]'), '')) needs: build-test permissions: contents: write - uses: cygporter/workflows/.github/workflows/prep-release.yml@v1 + uses: ./.github/workflows/prepare-release.yml with: - cygport_file: asciidoc.cygport publish: true release: if: startsWith(github.ref, join(fromJSON('["refs/heads/v", "${{ needs.build-test.outputs.pv }}"]'), '')) needs: [build-test, prep-release] - uses: cygporter/workflows/.github/workflows/release.yml@v1 + uses: ./.github/workflows/release.yml with: - cygport_file: asciidoc.cygport - tag_name: ${{ needs.prep-release.outputs.release_tag }} + release_tag: ${{ needs.prep-release.outputs.release_tag }} secrets: maintainer_key: ${{ secrets.maintainer_key }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d2de942 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,10 @@ +name: Build +on: + - workflow_dispatch + - workflow_call +jobs: + build-test: + uses: cygporter/workflows/.github/workflows/build-test.yml@v1 + with: + cygport_file: asciidoc.cygport + bootstrap_packages: cygport python3 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 915004f..15f0df3 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -12,6 +12,18 @@ on: required: false default: false type: boolean + workflow_call: + inputs: + release_tag: + description: Name for the release tag + required: false + default: '' + type: string + publish: + description: Whether to publish the release + required: false + default: false + type: boolean permissions: contents: write jobs: @@ -21,3 +33,4 @@ jobs: cygport_file: asciidoc.cygport release_tag: ${{ inputs.release_tag }} publish: ${{ inputs.publish }} + bootstrap_packages: cygport python3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84c2801..d73787b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,11 +6,23 @@ on: description: Name of the release tag required: true type: string + workflow_call: + inputs: + release_tag: + description: Name of the release tag + required: true + type: string + secrets: + maintainer_key: + description: RSA private key for uploading to Cygwin servers in OpenSSH format + required: true + jobs: release: uses: cygporter/workflows/.github/workflows/release.yml@v1 with: cygport_file: asciidoc.cygport tag_name: ${{ inputs.release_tag }} + bootstrap_packages: cygport python3 secrets: maintainer_key: ${{ secrets.maintainer_key }} From cfc7f0602b302113d6ca40913bb180f8dd9c23d3 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Thu, 19 Jan 2023 14:26:17 +0000 Subject: [PATCH 4/4] Correct git ref tests --- .github/workflows/build-test-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index fb6fe4e..4b0d2fd 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -5,7 +5,7 @@ jobs: uses: ./.github/workflows/build.yml prep-release: - if: startsWith(github.ref, join(fromJSON('["refs/heads/v", "${{ needs.build-test.outputs.pv }}"]'), '')) + if: github.ref == format('refs/heads/v{0}', needs.build-test.outputs.pv) needs: build-test permissions: contents: write @@ -14,7 +14,7 @@ jobs: publish: true release: - if: startsWith(github.ref, join(fromJSON('["refs/heads/v", "${{ needs.build-test.outputs.pv }}"]'), '')) + if: github.ref == format('refs/heads/v{0}', needs.build-test.outputs.pv) needs: [build-test, prep-release] uses: ./.github/workflows/release.yml with: