Automatic release new version, and notify your followers about it, using Github workflows

martinpham

Martin Pham

Posted on November 14, 2021

Automatic release new version, and notify your followers about it, using Github workflows

Automatic release new version on tag workflow

Managing an open source project really takes a lot of efforts. There are many repeated tasks which wastes your time everywhere: Testing, Building, Releasing, ... and sometimes, you'd also want to update your followers with the new released version.

Fortunately, Github actions & workflows came to rescue! With tons of available actions, we can automate many repeated & boring tasks, and keep our time to focus on code.

Today I'd like to share with you a GitHub worklow to build and release your application into a Github release, then notify your followers about this new release.

Workflow result

Telegram announcement

With this worklow, we automate all the testing, building steps and releasing steps, everytime you push a new release tag (example: v0.0.1, v0.0.2,...). Then send a new message about the newly released version to a Telegram channel.

Submission Category: DIY Deployments

Yaml File or Link to Code

GitHub logo ActionsHackathon21 / release-on-tag

Release a new version on very tag, then notify your followers on social networks

Release new version on tag

Bonus: Also notify your followers on every update!

This project follows the DEV.to #ActionsHackathon21 hackathon.

Use GitHub Actions and Workflows to build and release your application on every release tag.

Screenshot

Then send an announcement to your Telegram channel about the new release

Telegram

Check the complete workflow here (release-on-tag.yml)

Actions used

(Also actions/setup-node@v2 for setup nodejs, although it's not required)

Configurations

  • You can config the release tag prefix, with on.push.tags key.
  • To send announcement to Telegram, you need to configure the workflow using following steps
    • Talk with Telegram's @BotFather to create a new bot if you don't have one. We will use this bot to send messages to the Telegram channel. He…

In the repository, there is a sample NextJS project, however you can change a bit on the workflow file to match your project.

Configurations

  • You can config the release tag prefix, with on.push.tags key.
  • To send announcement to Telegram, you need to configure the workflow using following steps:
    • Talk with Telegram's @BotFather to create a new bot if you don't have one. We will use this bot to send messages to the Telegram channel. He will give you the token access the HTTP API.
    • On your Telegram channel, grant admin permissions to the bot.
    • Set the TELEGRAM_CHANNEL variable.
    • Add the TELEGRAM_BOT_TOKEN secret (using the token access above) into your repository secret (Settings > Secrets > New repository secret)

Pre-release

There is also a pre-release workflow (prerelease-on-push.yml), which will build and create a pre-release version of your application, on every push to main branch.

Pre-release version

πŸ’– πŸ’ͺ πŸ™… 🚩
martinpham
Martin Pham

Posted on November 14, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related