• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    PHP
  • License
    Other
  • Created over 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automated release process for `laminas/` projects, usable as github action

Release Automation

Build Status Psalm coverage

🇷🇺 Русским гражданам

Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.

У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.

Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"

🇺🇸 To Citizens of Russia

We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.

One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.

You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

This project is a Github Action that allows maintainers of open-source projects that follow SemVer to automate the automation of releases.

Installation

To use this automation in your own repository, copy the examples/.github workflows into your own project:

cd /tmp
git clone https://github.com/laminas/automatic-releases.git
cd /path/to/your/project
mkdir -p .github/workflows
# Copy selected flow that fits for your project
cp /tmp/automatic-releases/examples/.github/release-on-milestone-closed.yml .github/workflows
# ... or:
cp /tmp/automatic-releases/examples/.github/release-on-milestone-closed-triggering-release-event.yml .github/workflows
git add .github/workflows
git commit -m "Added release automation"

To get started you need to create a branch for the next release. e.g. if your next milestone will be 3.2.0 a 3.2.x branch is required.

Then add following secrets to your project or organization:

Secret Description
GIT_AUTHOR_NAME full name of the author of your releases: can be the name of a bot account.
GIT_AUTHOR_EMAIL email address of the author of your releases: can be an email address of a bot account.
SIGNING_SECRET_KEY a password-less private GPG key in ASCII format, to be used for signing your releases: please use a dedicated GPG subkey for this purpose. Unsigned releases are not supported, and won't be supported. See Setting up GPG keys below for help.
ORGANIZATION_ADMIN_TOKEN You have to provide an ORGANIZATION_ADMIN_TOKEN (with a full repo scope), which is a github token with administrative rights over your organization (or regular user project, for non-organization projects), issued by a user that has administrative rights over your project (that's you, if it is your own non-organization repository). This is required for the laminas:automatic-releases:switch-default-branch-to-next-minor command, because changing default branch of a repository currently requires administrative token rights. You can generate a token from your personal access tokens page.

The GITHUB_TOKEN secret you see in the examples is automatically created for you when you enable GitHub Actions. To learn more about how it works, read "Authenticating with the GITHUB_TOKEN" in the GitHub Docs.

Setting up GPG keys

Using a subkey from an existing GPG key

First open your master key for editing (use --list-keys to find it):

gpg --edit-key "<YOUR MASTER KEY ID>"

Type addkey and select a type that is for signing, you might be asked about bit size depending on your choice. When deciding over key expire, avoid setting to never expire, as recommendation of key bits will change over time. Type save to persist the new subkey to your master key. Make a note of the Key ID as you will need it in the next step.

Next export the new sub key:

gpg --output private.key --armor --export-secret-subkeys "<SubKey ID>!"

This will be exported to the file private.key. The ! at the end is important as it limits the export to just the sub key

Delete the file once you are done and don't share it with anyone else

If your master key is password protected, you will need to remove the password from the subkey before you can add it into github settings. You can skip this if your master key is not password protected.

To remove the password from the subkey, create an ephemeral gpg home directory:

install -d -m 700 gpg-tmp

Ensure that it works with gpg:

gpg --homedir gpg-tmp --list-keys

Import your subkey:

gpg --homedir gpg-tmp --import private.key

Enter edit mode:

gpg --homedir gpg-tmp --edit-key <SubKey ID>

Type passwd, entering your current password and then set the password to "" to remove it.

The command may give error error changing passphrase: No secret key when setting empty password. You should ignore it as the password was really removed.

Type save to exit edit mode and re-export your subkey:

gpg --homedir gpg-tmp --output private.key --armor --export-secret-subkeys "<SubKey ID>!"

Finally, remove the ephemeral directory:

rm -rf gpg-tmp

You will now need to export your master public key with the new subkey public key to the file public.key:

gpg --output public.key --armor --export <YOUR MASTER KEY ID>

Then republish it to anywhere that you currently publish your public keys.

Using a new key

To generate a new GPG key use the following command:

gpg2 --full-generate-key

Pick option 4, then type 4096 for key size, select your desired expiry. Fill out the user information and leave the password blank.

Once generated it will output something like gpg: key <Key ID> marked as ultimately trusted. Take a note of this Key Id to use in the next step.

Now output the key to the file private.key in the correct format to put into the environment variable required for setup:

gpg --output private.key --armor --export-secret-key <Key ID>

Delete the file once you are done and don't share it with anyone else

Optionally, you can export the corresponding public key to the file public.key:

gpg --output public.key --armor --export <Key ID>

You can publish this key on your project webpage to allow users to verify your signed releases. You could sign this new key with your personal key and the keys of other project maintainers to establish its provenance.

Usage

Assuming your project has Github Actions enabled, each time you close a milestone, this action will perform all following steps (or stop with an error):

  1. determine if all issues and pull requests associated with this milestone are closed
  2. determine if the milestone is named with the SemVer x.y.z format
  3. create a changelog by looking at the milestone description and associated issues and pull requests
  4. select branch x.y.z for the release (e.g. 1.1.x for a 1.1.0 release)
  5. create a tag named x.y.z on the selected branch, with the generated changelog
  6. publish a release named x.y.z, with the generated tag and changelog
  7. create (if applicable), a pull request from the selected branch to the next release branch
  8. create (if necessary) a "next minor" release branch x.y+1.z
  9. switch default repository branch to newest release branch

Please read the feature/ specification for more detailed scenarios on how the tool is supposed to operate.

Branching model

In this model we operate with release branches (e.g. 1.0.x, 1.1.x, 1.2.x). This provides a lot of flexibility whilst keeping a single workflow.

Working on new features

The current default release branch should be used. The default branch is always automatically changed after a new release is created.

An example is Mezzio that has 3.2.x as the current default release branch for simple features and deprecation notices and 4.0.x for the next major release.

Working on bug fixes

Bug fixes should be applied on the version which introduced the issue and then synchronized all way to the current default release branch via merge-ups.

Releasing

When releasing a new version x.y.z, a new branch will be created x.y+1.z and will be set as the next default release branch. If a hotfix x.y.z+1 is released, a merge-up branch is automatically created.

Synchronizing branches

To keep branches synchronized merge-ups are used.

That consists in getting the changes of a specific released branch merged all the way up to the current default branch. This ensures that all release branches are up-to-date and will never present a bug which has already been fixed. Merge-up branches are automatically created but needs to be merged manually into the targeted branch.

Example

Let's say we've released the versions 1.0.0 and 1.1.0. New features are being developed on 1.2.x. After a couple weeks, a bug was found on version 1.0.0.

The fix for that bug should be done based on the branch 1.0.x and, once merged, the branches should be updated in this way:

  1. Create a PR for the automatically created branch 1.0.x-merge-up-into-1.1.x_*, using 1.1.x as destination.
  2. Merge the new PR into 1.1.x.
  3. Create a PR for the automatically created branch 1.1.x-merge-up-into-1.2.x_*, using 1.2.x as destination.
  4. Merge the new PR into 1.2.x.

⚠️ when the merge-up can't be merged due to conflicts, it needs to be synced with the destination branch. That's done by merging the destination into the merge-up branch and resolving the conflicts locally:

  1. Update your local repository (git fetch origin)
  2. Checkout to merge-up branch (git checkout 1.1.x-merge-up-into-1.2.x_*)
  3. Sync merge-up branch (git merge --no-ff origin/1.2.x)
  4. Solve conflicts (using git mergetool or through an IDE)
  5. Resume merge (git merge --continue)
  6. Push (git push)

If needed you can create a merge-up branch manually: git checkout 1.0.x && git checkout -b 1.0.x-merge-up-into-1.1.x

Triggering release workflow events

Because the tokens generated by GitHub Actions are considered OAuth tokens, they are incapable of triggering further workflow events (see this document for an explanation).

As such, if you want to trigger a release event when automatic-releases runs, you will need to modify your .github/workflows/release-on-milestone-closed.yml file to assign the ORGANIZATION_ADMIN_TOKEN as the value of the GITHUB_TOKEN environment variable for the Release step:

    - name: "Release"
      uses: "./"
      with:
        command-name: "laminas:automatic-releases:release"
      env:
        "GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}

More Repositories

1

laminas-code

Extensions to the PHP Reflection API, static code scanning, and code generation
PHP
1,843
star
2

laminas-zendframework-bridge

Alias legacy ZF class names to Laminas Project equivalents.
PHP
1,185
star
3

laminas-eventmanager

Trigger and listen to events within a PHP application
PHP
1,014
star
4

laminas-diactoros

PSR HTTP Message implementations
PHP
472
star
5

laminas-stdlib

SPL extensions, array utilities, error handlers, and more
PHP
190
star
6

laminas-escaper

Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs
PHP
189
star
7

laminas-mvc-skeleton

Skeleton application for creating laminas-mvc based projects.
PHP
171
star
8

laminas-servicemanager

Factory-Driven Dependency Injection Container
PHP
149
star
9

laminas-mvc

Laminas's event-driven MVC layer, including MVC Applications, Controllers, and Plugins
PHP
142
star
10

laminas-feed

Consume and generate Atom and RSS feeds, and interact with Pubsubhubbub.
PHP
139
star
11

laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria
PHP
128
star
12

laminas-hydrator

Serialize objects to arrays, and vice versa
PHP
123
star
13

laminas-db

Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations
PHP
119
star
14

laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output
PHP
100
star
15

laminas-mail

Provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages
PHP
94
star
16

laminas-form

Validate and display simple and complex forms, casting forms to business objects and vice versa
PHP
80
star
17

laminas-filter

Programmatically filter and normalize data and files
PHP
79
star
18

laminas-view

Flexible view layer supporting and providing multiple view layers, helpers, and more
PHP
74
star
19

getlaminas.org

getlaminas.org source code
PHP
68
star
20

laminas-httphandlerrunner

Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.
PHP
63
star
21

laminas-migration

Migrate Zend Framework MVC applications, Expressive applications, Apigility applications, or third-party libraries to target Laminas.
PHP
62
star
22

laminas-soap

PHP
58
star
23

laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines
PHP
55
star
24

laminas-diagnostics

A set of components for performing diagnostic tests in PHP applications
PHP
55
star
25

laminas-session

Object-oriented interface to PHP sessions and storage
PHP
55
star
26

laminas-cli

Console command runner, exposing commands written in Laminas MVC and Mezzio components and applications
PHP
55
star
27

laminas-text

Create FIGlets and text-based tables
PHP
53
star
28

laminas-config

provides a nested object property based user interface for accessing this configuration data within application code
PHP
48
star
29

laminas-i18n

Provide translations for your application, and filter and validate internationalized values
PHP
47
star
30

laminas-inputfilter

Normalize and validate input sets from the web, APIs, the CLI, and more, including files
PHP
42
star
31

technical-steering-committee

Laminas Project Technical Steering Committee organization and processes.
39
star
32

laminas-crypt

Strong cryptography tools and password hashing
PHP
39
star
33

laminas-json

provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP
PHP
37
star
34

laminas-uri

A component that aids in manipulating and validating » Uniform Resource Identifiers (URIs)
PHP
37
star
35

laminas-di

Automated dependency injection for PSR-11 containers
PHP
36
star
36

laminas-http

Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests
PHP
36
star
37

laminas-router

Flexible routing system for HTTP and console applications
PHP
34
star
38

laminas-dependency-plugin

Replace zendframework and zfcampus packages with their Laminas Project equivalents.
PHP
33
star
39

laminas-serializer

Serialize and deserialize PHP structures to a variety of representations
PHP
33
star
40

tutorials

Learn how to create laminas-mvc applications, get in-depth guides into components, and discover how to migrate your applications to version 3!
33
star
41

laminas-permissions-acl

Provides a lightweight and flexible access control list (ACL) implementation for privileges management
PHP
32
star
42

laminas-coding-standard

The coding standard ruleset for Laminas components.
PHP
32
star
43

laminas-permissions-rbac

Provides a role-based access control management
PHP
30
star
44

laminas-modulemanager

Modular application system for laminas-mvc applications
PHP
30
star
45

laminas-mime

Create and parse MIME messages and parts
PHP
29
star
46

laminas-loader

Autoloading and plugin loading strategies
PHP
27
star
47

laminas-component-installer

Composer plugin for injecting modules and configuration providers into application configuration
PHP
27
star
48

laminas-math

Create cryptographically secure pseudo-random numbers, and manage big integers
PHP
26
star
49

laminas-log

Robust, composite logger with filtering, formatting, and PSR-3 support
PHP
26
star
50

laminas-server

Create Reflection-based RPC servers
PHP
25
star
51

laminas-barcode

Programmatically create and render barcodes as images or in PDFs
PHP
25
star
52

laminas-paginator

Paginate collections of data from arbitrary sources
PHP
25
star
53

laminas-xmlrpc

Fully-featured XML-RPC server and client implementations
PHP
24
star
54

laminas-developer-tools

Module for developer and debug tools for use with laminas-mvc applications.
PHP
24
star
55

laminas-captcha

Generate and validate CAPTCHAs using Figlets, images, ReCaptcha, and more
PHP
24
star
56

laminas-authentication

provides an API for authentication and includes concrete authentication adapters for common use case scenarios
PHP
24
star
57

laminas-ci-matrix-action

GitHub Action for creating a CI job matrix.
TypeScript
24
star
58

laminas-skeleton-installer

Installer plugin for Laminas MVC Skeleton application
PHP
23
star
59

laminas-config-aggregator

Lightweight library for collecting and merging configuration from different sources
PHP
23
star
60

laminas-mvc-middleware

Dispatch middleware pipelines in place of controllers in laminas-mvc.
PHP
23
star
61

laminas-continuous-integration-action

GitHub Action for running a QA check
Shell
19
star
62

laminas-development-mode

Laminas development mode script
PHP
17
star
63

laminas-dom

provides tools for working with DOM documents and structures
PHP
17
star
64

laminas-navigation

Manage trees of pointers to web pages in order to build navigation systems
PHP
17
star
65

laminas-json-server

Laminas Json-Server is a JSON-RPC server implementation.
PHP
17
star
66

laminas-xml

Utility library for XML usage, best practices, and security in PHP
PHP
14
star
67

laminas-mvc-i18n

Integration between laminas-mvc and laminas-i18n
PHP
14
star
68

laminas-file

Locate PHP classfiles
PHP
14
star
69

laminas.github.io

Source code for landing page and assets of https://docs.laminas.dev
HTML
14
star
70

laminas-test

Tools to facilitate integration testing of laminas-mvc applications
PHP
14
star
71

laminas-xml2json

Provides functionality for converting XML to JSON, optionally including XML attributes
PHP
13
star
72

laminas.dev

Developer website for Laminas https://www.laminas.dev
PHP
13
star
73

laminas-psr7bridge

PSR-7 <-> laminas-http message conversions
PHP
12
star
74

laminas-recaptcha

OOP wrapper for the ReCaptcha web service
PHP
11
star
75

laminas-mvc-plugin-flashmessenger

Plugin for creating and exposing flash messages via laminas-mvc controllers
PHP
10
star
76

documentation

Documentation repository for the Laminas Project components.
10
star
77

laminas-mvc-plugin-identity

Plugin for retrieving the current authenticated identity within laminas-mvc controllers
PHP
10
star
78

laminas-pimple-config

PSR-11 Pimple container configurator for Laminas and Mezzio applications
PHP
10
star
79

laminas-twitter

OOP wrapper for the Twitter web service
PHP
9
star
80

laminas-mvc-plugin-fileprg

Post/Redirect/Get plugin with file upload handling for laminas-mvc controllers
PHP
9
star
81

laminas-progressbar

Create and update progress bars in different environments
PHP
9
star
82

laminas-i18n-resources

Provides validator and captcha translations for laminas-i18n's Translator
PHP
9
star
83

laminas-config-aggregator-parameters

PostProcessor extension for laminas/laminas-config-aggregator to allow usage of templated parameters within your configuration
PHP
9
star
84

laminas-servicemanager-inspector

Make your autowiring reliable
PHP
8
star
85

laminas-ldap

Provides support for LDAP operations including but not limited to binding, searching and modifying entries in an LDAP directory
PHP
8
star
86

laminas-oauth

PHP
8
star
87

laminas-cache-storage-adapter-redis

PHP
8
star
88

laminas-console

Build console applications using getopt syntax or routing, complete with prompts
PHP
8
star
89

laminas-mvc-plugin-prg

Post/Redirect/Get plugin for laminas-mvc controllers
PHP
8
star
90

laminas-mvc-plugins

Collection of all stable laminas-mvc plugins served via separate packages.
7
star
91

laminas-composer-autoloading

Sets up Composer-based autoloading for your Laminas modules
PHP
7
star
92

laminas-cache-storage-adapter-filesystem

PHP
7
star
93

laminas-servicemanager-migration

Migrate your code to laminas-servicemanager 4.x compatibility utilizing Rector rules.
PHP
7
star
94

repo-template

Template repository for new Laminas components
PHP
6
star
95

laminas-tag

Manipulate and weight taggable items, and create tag clouds
PHP
6
star
96

laminas-mvc-form

Metapackage with all requirements needed to use laminas-form with laminas-mvc.
6
star
97

laminas-memory

Manage data in an environment with limited memory
PHP
6
star
98

.github

Laminas Organization Templates
5
star
99

laminas-cache-storage-adapter-memory

PHP
5
star
100

laminas-container-config-test

Mezzio PSR-11 container configuration tests
PHP
5
star