Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

28 Commits

Repository files navigation

Workflow versionLicense: MIT or Apache

Shared Workflows

This project gathers a list of workflows shared across multiple @farcaster-project repositories.

Usage

You can find an example of usage for the following shared workflows.

Draft new release

draft-new-release.yml prepare the creation of a new release by creating a new branch release/{version} and opening a pull request targeting main.

The changelog is updated to {version} and today's date. Cargo.toml version is updated to {version} and Cargo.lock is updated if input build (default false) is set to true. Set input check_publish (default false) to dry run publish.

Version should follow semantic versioning.

The commit will be associated with GitHub Actions bot.

Example of usage:

name: Draft new releaseon:
workflow_dispatch:
inputs:
version:
description: 'The new version in major.minor.patch format.'required: truejobs:
draft-new-release:
name: "Draft a new release"uses: farcaster-project/workflows/.github/workflows/draft-new-release.yml@v1.2.0with:
version: ${{ github.event.inputs.version }}build: falsecheck_publish: true

Create release

create-release.yml allows to create a GitHub release when merging a branch starting with release/ (this also creates a tag v{version}).

The release will be associated with GitHub Actions bot.

Example of usage:

name: Create releaseon:
pull_request:
types:
- closedjobs:
create_release:
name: Create from merged release branchif: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')uses: farcaster-project/workflows/.github/workflows/create-release.yml@v1.2.0

If you want to attach files to the release you can declare a create_release job with:

jobs:
produce_binaries:
name: Compile released binariesruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: Compile released binariesrun: ...
- name: Archive release folderuses: actions/upload-artifact@v2with:
name: release-folderpath: target/releaseretention-days: 7create_release:
name: Create from merged release branchif: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')uses: farcaster-project/workflows/.github/workflows/create-release.yml@v1.2.0needs: produce_binarieswith:
artifact_name: release-folderfiles: | target/release/bin1 target/release/bin2

You can add another job after create_release, e.g. release_to_crates, triggered only when the first is successfully completed i.e. when the release is published with:

release_to_crates:
name: Release to crates.iouses: farcaster-project/workflows/.github/workflows/release-to-crates-io.yml@v1.2.0needs: create_releasesecrets:
cratesio_token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Or use the method below with workflow_run: workflows: ["Name of the worflow"] to keep separated files.

Release to crates.io

release-to-crates-io.yml publish the crate to crates.io under the authentified user by cratesio_token. Example of stand-alone usage (see above for chained usage after create_release):

name: Release to crates.ioon:
release:
types: [ created ]jobs:
release:
name: "Publish the new release to crates.io"uses: farcaster-project/workflows/.github/workflows/release-to-crates-io.yml@v1.2.0secrets:
cratesio_token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

If you want to trigger this workflow after another you can add:

# Trigger when the "Create release" workflow succeededon:
workflow_run:
workflows: ["Create release"]types:
- completed

Where "Create release" is the name of the workflow that will trigger the "Release to crates.io" workflow when completed.

Changelog

See CHANGELOG.md for detailed version logs.

License

Licensed under either of

at your option.

About

Shared GitHub Actions' workflows across @farcaster-project projects.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Used by

Contributors