Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5d16e91 authored by Philipp Kewisch's avatar Philipp Kewisch
Browse files

Make use of summary tables in release automation

parent fe93152a
Loading
Loading
Loading
Loading
+46 −6
Original line number Diff line number Diff line
@@ -5,12 +5,13 @@ on:

jobs:
  get_environment:
    name: Determine Release Environment
    runs-on: ubuntu-latest
    outputs:
      releaseEnv: ${{ steps.getReleaseEnv.outputs.result }}
      releaseEnv: ${{ steps.releaseEnv.outputs.result }}
    steps:
      - uses: actions/github-script@v7
        id: getReleaseEnv
        id: releaseEnv
        with:
          result-encoding: string
          script: |
@@ -28,6 +29,7 @@ jobs:
            }

  dump_config:
    name: Show Release Environment
    runs-on: ubuntu-latest
    needs: get_environment
    environment: ${{ needs.get_environment.outputs.releaseEnv }}
@@ -36,20 +38,37 @@ jobs:
      matrixIncludeApk: ${{ steps.dump.outputs.matrixIncludeApk }}
      releaseType: ${{ vars.RELEASE_TYPE }}
    steps:
      - name: Dump environment
      - name: Show Environment
        uses: actions/github-script@v7
        id: dump
        env:
          vars: ${{ toJSON(vars) }}
          matrixInclude: ${{ vars.MATRIX_INCLUDE }}
          releaseType: ${{ vars.RELEASE_TYPE }}
        with:
          script: |
            console.log(process.env.vars);
            const matrix = JSON.parse(process.env.matrixInclude);
            const matrixApk = matrix.filter(item => item.packageFormat == "apk");
            core.setOutput("matrixIncludeApk", matrixApk);

            await core.summary
              .addRaw(`Beginning a ${process.env.releaseType} build with the following configurations:`, true)
              .addTable([
                [
                  { data: "App Name", header: true },
                  { data: "Flavor", header: true },
                  { data: "Format", header: true },
                ],
                ...matrix.map(item => [
                  { data: item.appName },
                  { data: item.packageFlavor || "default" },
                  { data: item.packageFormat },
                ])
              ])
              .write();


  build_unsigned:
    name: Build Unsigned
    runs-on: ubuntu-latest
    timeout-minutes: 90
    needs: [dump_config, get_environment]
@@ -142,6 +161,7 @@ jobs:
          if-no-files-found: error

  sign_mobile:
    name: Sign Packages
    runs-on: ubuntu-latest
    strategy:
      matrix:
@@ -180,6 +200,7 @@ jobs:
            uploads/*.aab

  pre_publish:
    name: Wait for Approval
    # This is a holding job meant to require approval before proceeding with the publishing jobs below
    # The environment has a deployment protection rule requiring approval from a set of named reviewers
    # before proceeding.
@@ -193,6 +214,7 @@ jobs:
          true

  github_release:
    name: GitHub Release
    runs-on: ubuntu-latest
    needs: [pre_publish, dump_config]
    strategy:
@@ -202,7 +224,6 @@ jobs:
    env:
      RELEASE_TYPE: ${{ needs.dump_config.outputs.releaseType }}
      APP_NAME: ${{ matrix.appName }}
      PACKAGE_FORMAT: ${{ matrix.packageFormat }}
      PACKAGE_FLAVOR: ${{ matrix.packageFlavor || 'default' }}
    steps:
      - uses: actions/download-artifact@v4
@@ -248,6 +269,7 @@ jobs:
          private-key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}

      - name: Publish
        id: publish
        uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191  # v2.0.8
        with:
          token: ${{ steps.app-token.outputs.token }}
@@ -258,3 +280,21 @@ jobs:
          fail_on_unmatched_files: true
          files: |
            uploads/${{ steps.rename.outputs.APK_FILE }}

      - name: Summary
        uses: actions/github-script@v7
        env:
          tagName: ${{ steps.apkinfo.outputs.TAG_NAME }}
          fullVersionName: ${{ steps.apkinfo.outputs.FULL_VERSION_NAME }}
          releaseUrl: ${{ steps.publish.outputs.url }}
          assets: ${{ steps.publish.outputs.assets }}
        with:
          script: |
            let assets = JSON.parse(process.env.assets);

            await core.summary
              .addRaw(`Release `)
              .addLink(process.env.fullVersionName, process.env.releaseUrl)
              .addRaw(`Tag ${process.env.tagName} at `)
              .addLink(context.sha, `${context.server_url}/${context.repository}/commit/${context.sha}`)
              .write();