[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Automatically create releases for pushed tags (dde1c57)

Marcel Fabian Krüger tex at 2krueger.de
Fri Jul 30 22:47:02 CEST 2021


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/dde1c5755cad88d7ccbc1579b2a66e2f23b9f1b5

>---------------------------------------------------------------

commit dde1c5755cad88d7ccbc1579b2a66e2f23b9f1b5
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri Jul 30 21:22:04 2021 +0200

    Automatically create releases for pushed tags


>---------------------------------------------------------------

dde1c5755cad88d7ccbc1579b2a66e2f23b9f1b5
 .github/workflows/{main.yaml => deploy.yaml} | 100 ++++++++-------------------
 .github/workflows/main.yaml                  |   4 +-
 2 files changed, 32 insertions(+), 72 deletions(-)

diff --git a/.github/workflows/main.yaml b/.github/workflows/deploy.yaml
similarity index 56%
copy from .github/workflows/main.yaml
copy to .github/workflows/deploy.yaml
index 2f9f16a..d405c10 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/deploy.yaml
@@ -1,38 +1,15 @@
-name: Automated testing
+name: Deployment
 
 # Currently we run in two situations:
 on:
-  # Whenever someone pushes to a branch or tag in our repo
+  # Only triggers for new tags
   push:
-  # Whenever a pull request is opened, reopened or gets new commits.
-  pull_request:
-# This implies that for every push to a local branch in our repo for which a
-# pull request is open this runs twice. But it's important to ensure that pull
-# requests get tested even if their branch comes from a fork.
+    tags: "*"
 
 jobs:
-  # The l3build job contains the actual work. We misuse the matrix mechanism to
-  # create three jobs which only differ in minimal elements.
+  # Mostly the same as the main.yaml workflow, but we only use a single job
   l3build:
     runs-on: ubuntu-20.04
-    strategy:
-      matrix:
-        # include indicates that we want to set explicitly these combinations
-        # and don't want full matrix testing.
-        # "name" is just to make the output more readable.
-        # "l3build_cmd" is the actual command to run
-        # "artifact_name" is which artifact might get generated by this step.
-        # IMPORTANT: artifact_name == "Documentation" is used as a trigger to
-        # generate the artifact from PDF files and not the build directory and
-        # to generate the artifact when the run is successful, not when it fails.
-        include:
-          - name: "Test suite"
-            l3build_cmd: l3build check -q -H --show-log-on-error
-            artifact_name: testfiles
-          - name: "Documentation"
-            l3build_cmd: l3build doc -q -H
-            artifact_name: Documentation
-    name: ${{matrix.name }}
     steps:
       # Boilerplate
       - name: Checkout repository
@@ -94,7 +71,7 @@ jobs:
             fontspec microtype unicode-math ttfutils
             #
             # fonts
-            sourcecodepro Asana-Math ebgaramond tex-gyre amsfonts gnu-freefont
+            sourcecodepro asana-math ebgaramond tex-gyre amsfonts gnu-freefont
             opensans fira tex-gyre-math junicode lm  lm-math amiri ipaex xits
             libertine coelacanth fontawesome stix2-otf dejavu luatexko
             unfonts-core cjk-ko iwona libertinus-fonts fandol cm-unicode noto
@@ -119,43 +96,28 @@ jobs:
             # warnings with some packages and errors with others
             metafont mfware texlive-scripts
       - name: Run l3build
-        run: ${{ matrix.l3build_cmd }}
-      # Now we create the artifacts: There are two cases where this happens.
-      # 1. If we failed running tests
-      - name: Archive failed test output
-        if: ${{ matrix.artifact_name != 'Documentation' && failure() }}
-        uses: actions/upload-artifact at v2
+        run: l3build ctan -H --show-log-on-error
+      - name: Create GitHub release
+        uses: ncipollo/release-action at 880be3d0a71bc0fa98db60201d2cbdc27324f547
+        id: release
         with:
-          name: ${{ matrix.artifact_name }}
-          path: build/test*/*.diff
-          # Decide how long to keep the test output artifact:
-          retention-days: 3
-      # 2. If we succeed building documentation
-      - name: Archive documentation
-        if: ${{ matrix.artifact_name == 'Documentation' && success() }}
-        uses: actions/upload-artifact at v2
+          artifacts: "build/distrib/ctan/*.zip"
+          prerelease: ${{ endsWith(github.ref, '-dev') }}
+          token: ${{ secrets.GITHUB_TOKEN }}
+      # To get the name of the release, we need to remove a prefix from a variable.
+      # Sadly, this isn't supported by GitHub's *extremely* limited expression syntax
+      # and we have to use a separate action instead.
+      #
+      - name: Get name
+        uses: frabert/replace-string-action at 9b62dfe3ae936b1cc380f2421c8ac9e63a4a3e85
+        id: name
         with:
-          name: ${{ matrix.artifact_name }}
-          path: "**/*.pdf"
-          # Decide how long to keep the test output artifact:
-          retention-days: 21
-  # GitHub automatically informs the initiator of any action about the result, but
-  # we additionally want to keep the latex-commits mailing list informed about
-  # test failures.
-  notifiy:
-    name: Send notifications
-    runs-on: ubuntu-20.04
-    # Run after the `l3build` job in order to be able to react to it's output.
-    needs: l3build
-    # Only run if the tests failed, we don't want to get notifications for every run.
-    # We don't want information for pull requests since for pull requests from local
-    # branches we already send notifications when the branch test fails and pull requests
-    # from forks can't access the username and password secrets required to send mails.
-    if: ${{ failure() && github.event_name != 'pull_request' }}
-    steps:
+          pattern: "^refs/tags/"
+          string: ${{ github.ref }}
+          replace-with: ""
+      # If a test failed, we already notified in the other workflow. Here we notify
+      # when a release has been created.
       - name: Send mail
-        # The explicit commit hash ensures that this can't be used by dawidd6 as a
-        # backdoor to execute arbitrary code during our runs.
         uses: dawidd6/action-send-mail at ceb614a2c5737d913f2d2729e2bcc70ad933382b
         with:
           # Currently using my (Marcel's) mail server for sending mails.
@@ -164,21 +126,17 @@ jobs:
           # These values can be changed in the repository settings.
           username: ${{secrets.MAIL_USERNAME}}
           password: ${{secrets.MAIL_PASSWORD}}
-          # If we want to send notifications to additional addresses, at them here as
+          # If we want to send notifications to additional addresses, add them here as
           # a comma separated list.
           to: latex3-commits at tug.org
           # The name is arbitrary, but if you want to change the address you need to
           # coordinate it with the administrator of the mail server to allow the account
           # to send from the mail address.
           from: LaTeX CI <github at latex-project.org>
-          priority: high
           # Determine the subject and body of the mail.
-          subject: "Test failed: ${{github.repository}} (${{github.ref}})"
+          subject: "New release for ${{github.repository}}: ${{steps.name.outputs.replaced}}"
           body: |
-            Test failure for ${{github.repository}}
-            -------------------------------------------------------------
+            The release ${{steps.name.outputs.replaced}} has been created for ${{github.repository}}.
 
-            On branch:        ${{github.ref}} (${{github.sha}})
-            Initiated by:     ${{github.actor}}
-            Commit URL:       https://github.com/${{github.repository}}/commit/${{github.sha}}
-            More information: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
+            More information can be found at
+            ${{steps.release.outputs.html_url}}
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 2f9f16a..793786a 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -4,6 +4,8 @@ name: Automated testing
 on:
   # Whenever someone pushes to a branch or tag in our repo
   push:
+    branches:
+      - "*"
   # Whenever a pull request is opened, reopened or gets new commits.
   pull_request:
 # This implies that for every push to a local branch in our repo for which a
@@ -94,7 +96,7 @@ jobs:
             fontspec microtype unicode-math ttfutils
             #
             # fonts
-            sourcecodepro Asana-Math ebgaramond tex-gyre amsfonts gnu-freefont
+            sourcecodepro asana-math ebgaramond tex-gyre amsfonts gnu-freefont
             opensans fira tex-gyre-math junicode lm  lm-math amiri ipaex xits
             libertine coelacanth fontawesome stix2-otf dejavu luatexko
             unfonts-core cjk-ko iwona libertinus-fonts fandol cm-unicode noto





More information about the latex3-commits mailing list.