aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/maennchen/zipstream-php/.github/workflows/part_release.yml
blob: c0f3867df8d9fb6cc69e1f775e0a6ce3434697bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
on:
  workflow_call:
    inputs:
      releaseName:
        required: true
        type: string
      stable:
        required: false
        type: boolean
        default: false

name: "Release"

permissions:
  contents: read

jobs:
  create:
    name: Create Release

    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
        with:
          egress-policy: audit

      - name: Create prerelease
        if: ${{ !inputs.stable }}
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: |
          gh release create \
            --repo ${{ github.repository }} \
            --title ${{ inputs.releaseName }} \
            --prerelease \
            --generate-notes \
            ${{ inputs.releaseName }}

      - name: Create release
        if: ${{ inputs.stable }}
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: |
          gh release create \
            --repo ${{ github.repository }} \
            --title ${{ inputs.releaseName }} \
            --generate-notes \
            ${{ inputs.releaseName }}

  upload_release:
    name: "Upload"

    needs: ["create"]

    runs-on: ubuntu-latest

    permissions:
      id-token: write
      contents: write
      attestations: write

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
        with:
          egress-policy: audit

      - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
      - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
        with:
          name: docs
          path: docs
      - run: |
          tar -czvf docs.tar.gz docs
      - name: "Attest Documentation"
        id: attestation
        uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
        with:
          subject-path: "docs.tar.gz"
      - name: Copy Attestation
        run: cp "$ATTESTATION" docs.tar.gz.sigstore
        env:
          ATTESTATION: "${{ steps.attestation.outputs.bundle-path }}"
      - name: Upload
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: |
          gh release upload --clobber "${{ github.ref_name }}" \
            docs.tar.gz docs.tar.gz.sigstore