Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow --version to overwrite addon version #62

Merged
merged 5 commits into from
Dec 7, 2020
Merged

Allow --version to overwrite addon version #62

merged 5 commits into from
Dec 7, 2020

Conversation

einschmidt
Copy link
Contributor

@einschmidt einschmidt commented Nov 26, 2020

Goal

Allow to set the build version for add-ons via the --version or -v parameter.

Use-case

Using the GitHub actions, I want to be able to use different actions for different purposes, and different results. For example:

  • Action 1 builds and uploads the addon release docker files. This is currently possible
  • Action 2 builds a dev/edge docker image that is using a specific tag/version which is different to the version of the stable addon, and which is not latest.

Change

  1. Don't set a local version variable when building an addon
  2. Read the version from config.json only when global version variable is empty (e.g. when not set, default)

desired example config

- name: Publish
  uses: home-assistant/builder@master
  with:
   args: |
    --all \
    --target /data \
    --version test \
    --docker-hub userspace-name

@homeassistant
Copy link

Hi @einschmidt,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@homeassistant
Copy link

Hi @einschmidt,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copy link
Member

@ludeeus ludeeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not enable --version for addons furthermore, this will break the build if --version is passed with --addon since version in the build_addon function will be blank.

@einschmidt
Copy link
Contributor Author

Thanks for the review @ludeeus. I reviewed the variables and changed the PR accordingly.
Happy to receive another review. :-)

@einschmidt einschmidt requested a review from ludeeus December 7, 2020 08:16
@ludeeus ludeeus merged commit 6362956 into home-assistant:master Dec 7, 2020
@einschmidt einschmidt deleted the patch-1 branch December 7, 2020 09:41
@tjorim
Copy link

tjorim commented Jan 23, 2021

Nice improvement, no more sed on the config.json to adjust the version 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants