Localazy Release Tags management with GitHub Actions
Tags: github, releasetags, cli, i18n
Published: 2022-07-16 16:57:00

**Release Tags are a great way of managing differing states of your translation. E.g., you can use one tag for production while another for the testing environment. To make things easier, it’s now possible to automate this process with GitHub actions.**

We already support automated [uploads](https://github.com/marketplace/actions/localazy-upload) and [downloads](https://github.com/marketplace/actions/localazy-download) with GitHub Actions for some time. For a general dive-in into the basic usage of Localazy's GitHub actions, check out our [previous article](https://localazy.com/blog/automated-localization-github-actions-localazy). Today, we're going to look at how we can take this automation one step further.

> Read the article: [Automated Localization: GitHub Actions ❤ Localazy](https://localazy.com/blog/automated-localization-github-actions-localazy)

## 🏷️ What are release tags?

Release tags work pretty much like tags on **GitHub**, **GitLab**, or **Docker**. They allow you to mark the state of your Localazy app, preserving the translations and translation progress at the given time, which is super helpful, for instance, when you use different branches for production, testing, and development.

You can preserve translations for production for as long as you are working on a new release, and only once you publish it, you start using the latest translations as well.

> You can read more about Release tags in the [documentation](https://localazy.com/docs/general/release-tags-add-on).

## 📚 A comprehensive overview

In the lines below, you'll find a comprehensive overview of everything Localazy's [Tag](https://github.com/marketplace/actions/localazy-tag) action can do for you. All the options are based on the capabilities of Localazy CLI.

> Check out related [documentation](https://localazy.com/docs/cli/release-tags) to read about every option in greater detail.

To run a GH action, you need to create a YAML file in `.github/workflows` in your code. Each example represents a single step of a complete custom workflow. You can skip to see the [full workflow](#full-worklow) to see the whole configuration.

> The following paragraphs presume you have access to Release tags through an active **[professional plan](https://localazy.com/docs/general/localazy-professional-tier)** and you have integrated Localazy in your code (there are write and read keys in either `localazy.json` or `localazy.keys.json`)

### List tags

This lists all the tags associated with your application.

```yaml
      - name: List tags
        uses: localazy/tag@v1
        with:
          list: true
```

### Publish tag

This command saves the current state of your app under a given `new-tag` name.

```yaml
      - name: Publish new-tag
        uses: localazy/tag@v1
        with:
          publish: 'new-tag'
```

### Promote tag

Replaces the target tag, `new-tag-2`, with the state of the `new-tag`.

```yaml
      - name: Promote new-tag
        uses: localazy/tag@v1   
        with:
          promote_from: 'new-tag'
          promote_to: 'new-tag-2'
```

### Rename tag

Simply renames the target tag.

```yaml
      - name: Rename new-tag
        uses: localazy/tag@v1   
        with:
          rename_from: 'new-tag'
          rename_to: 'renamed-tag'
```

### Merge tags

Merging tags allows you to apply translations from the source tag to the target tag. The result of the operation is stored as the output tag. Several optional parameters alter what kind of changes are applied.

> Check out the [documentation](https://localazy.com/docs/cli/release-tags#merging-and-manipulating-tags) for a complete overview.

In this example, we merge state of the `renamed-tag` into `new-tag-2` and save the output under a new `merged-tag`. On top of that, we added a single parameter `--add-languages` which adds any missing language to the target tag if the source tag contains any additional languages.

```yaml
      - name: Merge tag
        uses: localazy/tag@v1   
        with:
          merge_from: 'renamed-tag'
          merge_to: 'new-tag-2'
          merge_output: 'merged-tag'
          merge_parameters: '--add-languages'
```

### Delete tag

Lastly, this command deletes an existing tag.

```yaml
      - name: Delete renamed-tag
        uses: localazy/tag@v1   
        with:
          delete: 'renamed-tag'
```

## 🗃️ Full workflow

When this workflow successfully finishes, it will leave your app in the same state as before since the config will delete all the newly created tags at the end. Feel free to create a new testing project and try it out.

```yaml
### .github/workflows/locales.yml

on: [push]

jobs:
  release_tags:
    runs-on: ubuntu-latest
    name: Complex overview of tags management
    steps:
      - uses: actions/checkout@v1
      - name: List tags
        uses: localazy/tag@v1
        with:
          list: true
      - name: Publish new-tag
        uses: localazy/tag@v1
        with:
          publish: 'new-tag'
      - name: Publish new-tag-2
        uses: localazy/tag@v1   
        with:
          publish: 'new-tag-2'
      - name: Promote new-tag
        uses: localazy/tag@v1   
        with:
          promote_from: 'new-tag'
          promote_to: 'new-tag-2'
      - name: Rename new-tag
        uses: localazy/tag@v1   Q
        with:
          rename_from: 'new-tag'
          rename_to: 'renamed-tag'
      - name: Merge tag
        uses: localazy/tag@v1   
        with:
          merge_from: 'renamed-tag'
          merge_to: 'new-tag-2'
          merge_output: 'merged-tag'
          merge_parameters: '--add-languages'
      - name: Delete renamed-tag
        uses: localazy/tag@v1   
        with:
          delete: 'renamed-tag'
      - name: Delete merged-tag
        uses: localazy/tag@v1   
        with:
          delete: 'merged-tag'
      - name: Delete new-tag-2
        uses: localazy/tag@v1   
        with:
          delete: 'new-tag-2'
```

## ✔️ Closing words

This was a comprehensive overview of what you can do with Github actions and Localazy's Release Tags. You may checkout the sample [repo](https://github.com/localazy/localazy-gh-action-tags-example) for reference. Happy coding!

### You might also like

*   [Why productive (mobile) developers choose Bitrise for CI/CD](https://localazy.com/blog/productive-mobile-developers-love-bitrise-localazy)
*   [What is a True Continuous Localization by Localazy](https://localazy.com/blog/true-continuous-localization-localazy)
*   [Automated Localization: GitHub Actions ❤ Localazy](https://localazy.com/blog/automated-localization-github-actions-localazy)