Skip to content

Commit

Permalink
all binaries should build under same ref/tag
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamadazmy committed Oct 17, 2023
1 parent 68c54f8 commit 046c9aa
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 232 deletions.
73 changes: 17 additions & 56 deletions .github/workflows/bin-package-18.04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@ name: Build Extra Binary
on:
workflow_call:
inputs:
development:
description: "development hub repo"
required: false
default: tf-zos-v3-bins.dev
type: string
quality:
description: "qa hub repo"
required: false
default: tf-zos-v3-bins.qanet
type: string
testing:
description: "testing hub repo"
required: false
default: tf-zos-v3-bins.test
type: string
production:
description: "main hub repo"
required: false
default: tf-zos-v3-bins
type: string
package:
description: "package to build"
required: true
Expand All @@ -33,20 +13,28 @@ on:
jobs:
builder:
name: builder
runs-on: ubuntu-latest
container: ubuntu:18.04
runs-on: ubuntu-18.04
steps:
- name: Checkout code into the Go module directory
uses: actions/checkout@v1
- name: Set tag of build
id: tag
run: |
ref="${{ github.ref }}"
if [[ "${{ github.ref_type }}" = "tag" ]]; then
echo "reference=${ref#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "reference=${ref}"" >> $GITHUB_OUTPUT
fi
- name: Setup basesystem
run: |
cd bins
./bins-extra.sh --package basesystem
sudo ./bins-extra.sh --package basesystem
- name: Build package (${{ inputs.package }})
id: package
run: |
cd bins
./bins-extra.sh --package ${{ inputs.package }}
sudo ./bins-extra.sh --package ${{ inputs.package }}
- name: Publish flist (tf-autobuilder, ${{ steps.package.outputs.name }})
if: success()
uses: threefoldtech/publish-flist@master
Expand All @@ -56,39 +44,12 @@ jobs:
user: tf-autobuilder
root: bins/releases/${{ inputs.package }}
name: ${{ steps.package.outputs.name }}.flist
- name: Publishing (development)
- name: Publishing
uses: threefoldtech/publish-flist@master
if: success() && github.ref == 'refs/heads/main'
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.development }}
name: ${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
- name: Publishing (quality)
uses: threefoldtech/publish-flist@master
if: success() && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-qa')
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.quality }}
name: ${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
- name: Publishing (testing)
uses: threefoldtech/publish-flist@master
if: success() && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-rc')
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.testing }}
name: ${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
- name: Publishing (production)
uses: threefoldtech/publish-flist@master
if: success() && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-rc') && !contains(github.ref, '-qa')
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.production }}
name: ${{ inputs.package }}.flist
token: ${{ secrets.HUB_JWT }}
action: tag
user: tf-autobuilder
name: ${{ steps.tag.outputs.reference }}/${{ input.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
66 changes: 14 additions & 52 deletions .github/workflows/bin-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@ name: Build Extra Binary
on:
workflow_call:
inputs:
development:
description: "development hub repo"
required: false
default: tf-zos-v3-bins.dev
type: string
quality:
description: "qa hub repo"
required: false
default: tf-zos-v3-bins.qanet
type: string
testing:
description: "testing hub repo"
required: false
default: tf-zos-v3-bins.test
type: string
production:
description: "main hub repo"
required: false
default: tf-zos-v3-bins
type: string
package:
description: "package to build"
required: true
Expand All @@ -37,6 +17,15 @@ jobs:
steps:
- name: Checkout code into the Go module directory
uses: actions/checkout@v1
- name: Set tag of build
id: tag
run: |
ref="${{ github.ref }}"
if [[ "${{ github.ref_type }}" = "tag" ]]; then
echo "reference=${ref#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "reference=${ref}"" >> $GITHUB_OUTPUT
fi
- name: Setup basesystem
run: |
cd bins
Expand All @@ -55,39 +44,12 @@ jobs:
user: tf-autobuilder
root: bins/releases/${{ inputs.package }}
name: ${{ steps.package.outputs.name }}.flist
- name: Publishing (development)
- name: Publishing
uses: threefoldtech/publish-flist@master
if: success() && github.ref == 'refs/heads/main'
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.development }}
name: ${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
- name: Publishing (quality)
uses: threefoldtech/publish-flist@master
if: success() && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-qa')
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.quality }}
name: ${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
- name: Publishing (testing)
uses: threefoldtech/publish-flist@master
if: success() && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-rc')
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.testing }}
name: ${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
- name: Publishing (production)
uses: threefoldtech/publish-flist@master
if: success() && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-rc') && !contains(github.ref, '-qa')
with:
token: ${{ secrets.token }}
action: crosslink
user: ${{ inputs.production }}
name: ${{ inputs.package }}.flist
token: ${{ secrets.HUB_JWT }}
action: tag
user: tf-autobuilder
name: ${{ steps.tag.outputs.reference }}/${{ input.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist
61 changes: 0 additions & 61 deletions .github/workflows/publish-pre-release.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/publish-release.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ jobs:
env:
GO111MODULE: on

- name: Set tag of build
id: tag
run: |
ref="${{ github.ref }}"
if [[ "${{ github.ref_type }}" = "tag" ]]; then
echo "reference=${ref#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "reference=${ref}"" >> $GITHUB_OUTPUT
fi
- name: Collecting files
run: |
scripts/collect.sh ${{ github.workspace }}/archive
Expand All @@ -48,7 +58,7 @@ jobs:
token: ${{ secrets.HUB_JWT }}
action: tag
user: tf-autobuilder
name: ${{ github.sha }}/zos.flist
name: ${{ steps.tag.outputs.reference }}/zos.flist
target: tf-autobuilder/zos-${{ github.sha }}.flist

- name: Cross tagging (development)
Expand Down

0 comments on commit 046c9aa

Please sign in to comment.