Skip to content

Commit 560ded0

Browse files
committed
Add a github workflow.
1 parent f773953 commit 560ded0

4 files changed

Lines changed: 169 additions & 27 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Build with Meson and Ninja"
2+
description: "Checks out code, sets up Python, and builds using Meson and Ninja"
3+
inputs:
4+
python-version:
5+
description: "Python version to use"
6+
required: true
7+
default: "3.x"
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Set up Python
12+
uses: actions/setup-python@v3
13+
with:
14+
python-version: ${{ inputs.python-version }}
15+
16+
- name: Install libraries
17+
# run: apk add --no-cache vulkan-loader-dev libdrm-dev libpng-dev ninja-build meson
18+
run: sudo apt-get install libvulkan-dev libdrm-dev libpng-dev ninja-build
19+
shell: bash
20+
21+
- name: Install Meson and Ninja
22+
run: pip install meson
23+
shell: bash
24+
25+
- name: Configure build with Meson on linux
26+
env:
27+
# Customize the meson build type here (release, debug, debugoptimized, etc.)
28+
BUILD_TYPE: release
29+
run: |
30+
meson setup builddir --buildtype=${{env.BUILD_TYPE}}
31+
shell: bash
32+
33+
- name: Compile
34+
run: meson compile -C builddir
35+
shell: bash

.github/workflows/meson.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Verify Pull Request
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- fork_main
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v3
19+
20+
- name: Build project action
21+
uses: ./.github/actions/project_build

.github/workflows/releases.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Release Releases for dxvk-tests
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- fork_main
10+
tags:
11+
- v[0-9]+.*
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
jobs:
16+
build_artifacts:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out repository code
20+
uses: actions/checkout@v3
21+
22+
- name: Build project action
23+
uses: ./.github/actions/project_build
24+
25+
- name: Rename linux build artifacts
26+
run: |
27+
mv builddir/vkcube builddir/vkcube-linux
28+
shell: bash
29+
30+
- name: Upload build artifacts
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: build
34+
path: |
35+
builddir/vkcube-linux
36+
if-no-files-found: error
37+
38+
do_release:
39+
runs-on: ubuntu-latest
40+
needs: build_artifacts
41+
42+
steps:
43+
- name: Unpack build artifacts
44+
uses: actions/download-artifact@v2
45+
with:
46+
name: build
47+
path: builddir
48+
49+
- name: Delete existing latest_build Pre-Release
50+
uses: actions/github-script@v7
51+
with:
52+
github-token: ${{ secrets.GITHUB_TOKEN }}
53+
script: |
54+
const { data: releases } = await github.rest.repos.listReleases({
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
});
58+
for (const release of releases) {
59+
if (release.prerelease && release.name.startsWith('Latest build of branch')) {
60+
await github.rest.repos.deleteRelease({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
release_id: release.id,
64+
});
65+
}
66+
}
67+
const { data: tags } = await github.rest.git.listMatchingRefs({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
ref: 'tags/latest_build',
71+
});
72+
if (tags.length > 0)
73+
await github.rest.git.deleteRef({
74+
owner: context.repo.owner,
75+
repo: context.repo.repo,
76+
ref: 'tags/latest_build',
77+
});
78+
79+
- name: Check Tag Format
80+
id: check_tag
81+
if: startsWith(github.ref, 'refs/tags/') # Ensure this runs for tags only
82+
run: |
83+
if [[ "${{ github.ref_name }}" =~ ^v[0-9]+.*$ ]]; then
84+
echo "tag_matches=true" >> $GITHUB_OUTPUT
85+
else
86+
echo "tag_matches=false" >> $GITHUB_OUTPUT
87+
fi
88+
shell: bash
89+
90+
- name: Create latest build Pre-Release
91+
if: steps.check_tag.outputs.tag_matches != 'true'
92+
uses: ncipollo/release-action@v1
93+
with:
94+
prerelease: true
95+
draft: false
96+
allowUpdates: true
97+
removeArtifacts: true
98+
name: Latest build of branch ${{ github.ref_name }}
99+
commit: ${{ github.ref }}
100+
tag: latest_build
101+
artifacts: |
102+
builddir/*
103+
104+
- name: Create Tagged Release
105+
if: steps.check_tag.outputs.tag_matches == 'true'
106+
uses: ncipollo/release-action@v1
107+
with:
108+
prerelease: false
109+
removeArtifacts: true
110+
name: Release ${{ github.ref_name }}
111+
tag: ${{ github.ref_name }}
112+
artifacts: |
113+
builddir/*

0 commit comments

Comments
 (0)