Skip to content

Commit 26a761e

Browse files
committed
feat: improve release workflow and update steps
1 parent 4c027c0 commit 26a761e

3 files changed

Lines changed: 45 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,45 @@
11
name: Release
22

33
on:
4-
release:
5-
types: created
4+
# This will trigger when a tag like v1.0.0 is pushed
5+
# will create a release
6+
push:
7+
tags:
8+
- "*.*.*"
9+
# Manual trigger for creating an artifact (button in the UI)
10+
workflow_dispatch:
11+
12+
permissions:
13+
packages: write
14+
contents: write
615

716
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@master
12-
- name: Build poppler
13-
run: make distribution
14-
- name: Upload the artifacts
15-
uses: actions/upload-artifact@v1
16-
with:
17-
name: poppler
18-
path: export/poppler.zip
19-
- name: Publish the artifacts
20-
uses: actions/upload-release-asset@v1
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
with:
24-
upload_url: ${{ github.event.release.upload_url }}
25-
asset_path: export/poppler.zip
26-
asset_name: poppler.zip
27-
asset_content_type: application/zip
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
steps:
21+
# Checkout the repo for building
22+
- uses: actions/checkout@v4
23+
24+
# Build release binaries
25+
- name: Build poppler
26+
run: make distribution ${{ github.ref_name }}
27+
28+
# Upload build artifact
29+
- name: Upload the artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: poppler
33+
path: export/poppler.zip
34+
35+
# Create the github release if we pushed up a new tag
36+
- name: Create GitHub Release
37+
uses: softprops/action-gh-release@v2
38+
if: github.event_name == 'push'
39+
with:
40+
tag_name: ${{ github.ref_name }}
41+
name: v${{ github.ref_name }}
42+
draft: true
43+
files: export/poppler.zip
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
SHELL := /bin/bash
22

3+
# Default version
4+
POPPLER_VERSION ?= 25.12.0
5+
36
compiler: compiler.Dockerfile
47
docker build -f ${PWD}/compiler.Dockerfile -t jeylabs/poppler/compiler:latest .
58

@@ -8,6 +11,7 @@ build: compiler
811

912
distribution: build
1013
docker run --rm \
14+
--build-arg VERSION_POPPLER=${POPPLER_VERSION} \
1115
--env ZIP_FILE_NAME=poppler \
1216
--volume ${PWD}/export:/export \
1317
--volume ${PWD}/runtime:/runtime \

compiler.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ RUN set -xe; \
398398

399399
# Install Poppler (https://gitlab.freedesktop.org/poppler/poppler/-/tags)
400400

401-
ENV VERSION_POPPLER=25.12.0
401+
ARG VERSION_POPPLER=25.12.0
402402
ENV POPPLER_BUILD_DIR=${BUILD_DIR}/poppler
403403
ENV POPPLER_TEST_DIR=${BUILD_DIR}/poppler-test
404404

0 commit comments

Comments
 (0)