Skip to content

Commit ffa74d3

Browse files
authored
GitHub Actions: Add Publish workflow (#65)
1 parent 8d3599d commit ffa74d3

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

.github/workflows/publish.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Git tag for the release. For example, v1.2.3'
8+
required: false
9+
release:
10+
types:
11+
- published
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ inputs.version }}
15+
cancel-in-progress: true
16+
17+
permissions: {}
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
jobs:
24+
homebrew:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Create GitHub App Token
28+
uses: actions/create-github-app-token@v2
29+
id: app-token
30+
with:
31+
app-id: ${{ vars.TASTENDRUCK_APP_ID }}
32+
private-key: ${{ secrets.TASTENDRUCK_PRIVATE_KEY }}
33+
owner: ${{ github.repository_owner }}
34+
repositories: homebrew-tap
35+
permission-actions: write
36+
37+
- name: Dispatch Update Workflow on Homebrew Tap Repository
38+
run: |
39+
gh workflow run update.yml \
40+
--repo "typisttech/homebrew-tap" \
41+
--ref "main"
42+
env:
43+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
44+
45+
cloudsmith:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- run: gh release download --repo "${REPO}" --pattern '*.deb' "${TAG}"
49+
env:
50+
REPO: ${{ github.repository }}
51+
TAG: ${{ inputs.version || github.ref_name }}
52+
GH_TOKEN: ${{ github.token }}
53+
54+
- name: Attestation verification
55+
run: |
56+
for arch in ${ARCHS}; do
57+
echo "::group::==> ${arch}"
58+
gh attestation verify --repo "${REPO}" "php-matrix_linux_${arch}.deb"
59+
echo "::endgroup::"
60+
done
61+
env:
62+
REPO: ${{ github.repository }}
63+
ARCHS: "arm64 amd64"
64+
GH_TOKEN: ${{ github.token }}
65+
66+
- name: Push php-matrix_linux_arm64.deb
67+
uses: cloudsmith-io/action@v0.6.14
68+
with:
69+
api-key: ${{ secrets.CLOUDSMITH_API_KEY_TASTENDRUCK }}
70+
command: push
71+
format: deb
72+
owner: typisttech
73+
repo: oss
74+
distro: any-distro
75+
release: any-version
76+
no-wait-for-sync: true
77+
file: php-matrix_linux_arm64.deb
78+
79+
- name: Push php-matrix_linux_amd64.deb
80+
uses: cloudsmith-io/action@v0.6.14
81+
with:
82+
api-key: ${{ secrets.CLOUDSMITH_API_KEY_TASTENDRUCK }}
83+
command: push
84+
format: deb
85+
owner: typisttech
86+
repo: oss
87+
distro: any-distro
88+
release: any-version
89+
no-wait-for-sync: true
90+
file: php-matrix_linux_amd64.deb

0 commit comments

Comments
 (0)