Skip to content

Commit

Permalink
Only tag on main branch or if tagged
Browse files Browse the repository at this point in the history
Builds will still be executed, but not tagged until
merged into main net and or version tagged
  • Loading branch information
muhamadazmy committed Oct 19, 2023
1 parent e1a15c2 commit ada147e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bin-package-18.04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
name: ${{ steps.package.outputs.name }}.flist
- name: Tagging
uses: threefoldtech/publish-flist@master
if: success()
if: success() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
token: ${{ secrets.token }}
action: tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bin-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
name: ${{ steps.package.outputs.name }}.flist
- name: Tagging
uses: threefoldtech/publish-flist@master
if: success()
if: success() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
token: ${{ secrets.token }}
action: tag
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- "*"
tags:
- "v*"
jobs:
containerd:
uses: ./.github/workflows/bin-package.yaml
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- "*"
tags:
- "v*"
jobs:
build:
name: Build and upload
Expand Down Expand Up @@ -55,15 +57,21 @@ jobs:
root: archive
name: zos:${{ steps.version.outputs.version }}.flist

# we tag only if and only if we merged to main
# in that case the tag will be the short sha.
# or if we tagged a certain version and that
# will use the tag value (has to start with v)
- name: Tagging
uses: threefoldtech/publish-flist@master
if: success() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
token: ${{ secrets.HUB_JWT }}
action: tag
user: tf-autobuilder
name: ${{ steps.tag.outputs.reference }}/zos.flist
target: tf-autobuilder/zos:${{ steps.version.outputs.version }}.flist

# only for main branch (devnet)
- name: Cross tagging (development)
if: success() && github.ref == 'refs/heads/main'
uses: threefoldtech/publish-flist@master
Expand Down

0 comments on commit ada147e

Please sign in to comment.