Skip to content

Commit 3eb4f56

Browse files
authored
ci: hopefully final CI fixes (#87)
1 parent 9d00a02 commit 3eb4f56

File tree

2 files changed

+57
-52
lines changed

2 files changed

+57
-52
lines changed

.github/workflows/publish-docker.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 🐋 Publish Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
attestations: write
11+
packages: write
12+
id-token: write
13+
14+
jobs:
15+
docker:
16+
runs-on: ubuntu-latest
17+
steps:
18+
build_image:
19+
if: github.repository == 'PCSX2/web-api'
20+
needs:
21+
- cut_release
22+
name: "Build and Publish Image"
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
40+
- name: Build and push Docker image
41+
id: push
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
49+
- name: Generate artifact attestation
50+
uses: actions/attest-build-provenance@v2
51+
with:
52+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
53+
subject-digest: ${{ steps.push.outputs.digest }}
54+
push-to-registry: true

.github/workflows/release.yml

+3-52
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ env:
1919

2020
permissions:
2121
contents: write
22-
attestations: write
23-
packages: write
2422

2523
jobs:
2624
cut_release:
25+
if: github.repository == 'PCSX2/web-api'
2726
name: Cut Release
2827
runs-on: ubuntu-latest
2928
outputs:
3029
new_tag: ${{ steps.set_tag.outputs.new_tag }}
3130
steps:
3231
# Docs - https://github.com/mathieudutour/github-tag-action
3332
- name: Bump Version and Push Tag
34-
if: github.repository == 'PCSX2/web-api'
3533
id: tag_version
3634
uses: mathieudutour/[email protected]
3735
with:
@@ -42,56 +40,9 @@ jobs:
4240
- name: Create Release
4341
env:
4442
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
run: gh release create ${{ steps.tag_version.outputs.new_tag }} --generate-notes --draft --repo ${{ github.repository }}
43+
run: gh release create ${{ steps.tag_version.outputs.new_tag }} --generate-notes --repo ${{ github.repository }}
4644

4745
- name: Output new tag
4846
id: set_tag
4947
run: |
50-
echo "new_tag=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_OUTPUT
51-
52-
build_image:
53-
if: github.repository == 'PCSX2/web-api'
54-
needs:
55-
- cut_release
56-
name: "Build and Publish Image"
57-
runs-on: ubuntu-latest
58-
steps:
59-
- uses: actions/checkout@v4
60-
with:
61-
ref: ${{ needs.cut_release.outputs.new_tag }}
62-
63-
- name: Log in to the Container registry
64-
uses: docker/login-action@v3
65-
with:
66-
registry: ${{ env.REGISTRY }}
67-
username: ${{ github.actor }}
68-
password: ${{ secrets.GITHUB_TOKEN }}
69-
70-
- name: Extract metadata (tags, labels) for Docker
71-
id: meta
72-
uses: docker/metadata-action@v5
73-
with:
74-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
75-
76-
- name: Build and push Docker image
77-
id: push
78-
uses: docker/build-push-action@v6
79-
with:
80-
context: .
81-
push: true
82-
tags: ${{ steps.meta.outputs.tags }}
83-
labels: ${{ steps.meta.outputs.labels }}
84-
85-
- name: Generate artifact attestation
86-
uses: actions/attest-build-provenance@v2
87-
with:
88-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
89-
subject-digest: ${{ steps.push.outputs.digest }}
90-
push-to-registry: true
91-
92-
- name: Publish Release
93-
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
run: |
96-
TAG_VAL=${{ needs.cut_release.outputs.new_tag }}
97-
gh release edit ${TAG_VAL} --draft=false --repo open-goal/jak-project
48+
echo "new_tag=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)