Skip to content

Commit 87c8cea

Browse files
mesakMesak
authored andcommitted
refactor: Consolidate release build and artifact upload into version-release workflow, simplify Dockerfile extension installation, and bump package version.
1 parent d0e6318 commit 87c8cea

File tree

6 files changed

+20
-52
lines changed

6 files changed

+20
-52
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/version-release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ jobs:
5656
with:
5757
fetch-depth: 0
5858

59+
- name: Setup Rust
60+
uses: dtolnay/rust-toolchain@stable
61+
62+
- name: Build Release
63+
run: cargo build --release
64+
5965
- name: Create Git tag
6066
run: |
6167
VERSION=${{ needs.check-version.outputs.version }}
@@ -67,12 +73,10 @@ jobs:
6773
git push origin "$TAG_NAME"
6874
6975
- name: Create GitHub Release
70-
uses: actions/create-release@v1
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
uses: softprops/action-gh-release@v1
7377
with:
7478
tag_name: v${{ needs.check-version.outputs.version }}
75-
release_name: Release v${{ needs.check-version.outputs.version }}
79+
name: Release v${{ needs.check-version.outputs.version }}
7680
body: |
7781
# PHP TOON Extension v${{ needs.check-version.outputs.version }}
7882
@@ -86,6 +90,7 @@ jobs:
8690
8791
## What's New
8892
View the [git log](../../compare/$(git describe --tags --abbrev=0 HEAD^)...v${{ needs.check-version.outputs.version }}) for changes in this release.
93+
files: target/release/libphp_rs_toon.so
8994
draft: false
9095
prerelease: false
9196

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "php-rs-toon"
3-
version = "1.0.3"
3+
version = "1.0.4"
44
edition = "2021"
55

66
[lib]

Dockerfile.benchmark

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
1616
# Set working directory
1717
WORKDIR /app
1818

19-
# Copy all files including the pre-co# Download and install php-rs-toon extension from GitHub release
19+
# Download and install php-rs-toon extension from GitHub release
2020
ARG TOON_VERSION=1.0.3
21-
RUN mkdir -p /tmp/extension && \
22-
cd /tmp/extension && \
23-
curl -L https://github.com/mesak/php-rs-toon/releases/download/v${TOON_VERSION}/php-rs-toon-linux-x86_64.zip \
24-
-o extension.zip && \
25-
unzip extension.zip && \
26-
mv libphp_rs_toon.so $(php-config --extension-dir)/ && \
27-
echo "extension=libphp_rs_toon.so" > /usr/local/etc/php/conf.d/php-rs-toon.ini && \
28-
cd / && rm -rf /tmp/extension
21+
RUN curl -L https://github.com/mesak/php-rs-toon/releases/download/v${TOON_VERSION}/libphp_rs_toon.so \
22+
-o $(php-config --extension-dir)/libphp_rs_toon.so && \
23+
chmod +x $(php-config --extension-dir)/libphp_rs_toon.so && \
24+
echo "extension=libphp_rs_toon.so" > /usr/local/etc/php/conf.d/php-rs-toon.ini
2925
# Verify extension is loaded
3026
RUN php -m | grep php-rs-toon || (echo "Extension not loaded!" && exit 1)
3127

Dockerfile.prod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ WORKDIR /app
1717

1818
# Download and install the php-rs-toon extension from GitHub release
1919
ARG TOON_VERSION=1.0.3
20-
RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/* && \
21-
curl -L https://github.com/mesak/php-rs-toon/releases/download/v${TOON_VERSION}/php-rs-toon-linux-x86_64.zip \
22-
-o /tmp/extension.zip && \
23-
unzip /tmp/extension.zip -d /tmp && \
24-
mv /tmp/libphp_rs_toon.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/libphp_rs_toon.so && \
25-
rm /tmp/extension.zip
20+
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* && \
21+
curl -L https://github.com/mesak/php-rs-toon/releases/download/v${TOON_VERSION}/libphp_rs_toon.so \
22+
-o /usr/local/lib/php/extensions/no-debug-non-zts-20220829/libphp_rs_toon.so && \
23+
chmod +x /usr/local/lib/php/extensions/no-debug-non-zts-20220829/libphp_rs_toon.so
2624

2725
# Enable the extension
2826
RUN echo "extension=libphp_rs_toon.so" > /usr/local/etc/php/conf.d/php-rs-toon.ini

0 commit comments

Comments
 (0)