Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Generic Workflow to build component packages #39

Closed
shailesh-vaidya opened this issue Aug 4, 2020 · 8 comments
Closed

Generic Workflow to build component packages #39

shailesh-vaidya opened this issue Aug 4, 2020 · 8 comments
Assignees
Labels
github actions GitHub Action related changes improvement Improvement in current workflow. Status: Fix Scheduled Will be fixed in an upcoming release or sooner Status: L1 Triage Initial triage Triage: DevAd Triage owner is a developer advocate

Comments

@shailesh-vaidya
Copy link
Contributor

We should use generic workflow to build component rpm's . I have created one for Provisioner at provisioner-build.yml . It will also need changes in Dockerfile's .

jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    
    - name: Checkout
      uses: actions/checkout@v2
      with:
        # Repository name with owner. For example, actions/checkout
        repository: Seagate/cortx-prvsnr
        token: ${{ secrets.TOKEN }}
        path: provisioner

    # Runs a set of commands using the runners shell
    - name: Build Provisioner packages
      run: |
        echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
        docker pull docker.pkg.github.com/seagate/cortx-re/cortx_centos:7.7.1908
        docker run -i -v $PWD:/build docker.pkg.github.com/seagate/cortx-re/cortx_centos:7.7.1908 'sh /build/build_scripts/build_provisoiner.sh'
       
    - name: Upload files to a GitHub release
      uses: svenstaro/upload-release-action@2.0.0
      with:
        repo_token: ${{ secrets.TOKEN }}
        release_name: provisioner
        file: provisioner/release/*.rpm
        tag: 1.0.0
        file_glob: true
        body: "Provisioner Release"

There are some better actions available to upload artifacts to GitHub releases. We can try out them. Do review and provide suggestions.

@shailesh-vaidya shailesh-vaidya added the improvement Improvement in current workflow. label Aug 4, 2020
@shailesh-vaidya shailesh-vaidya self-assigned this Aug 4, 2020
@shailesh-vaidya shailesh-vaidya added the github actions GitHub Action related changes label Aug 4, 2020
@stale
Copy link

stale bot commented Aug 13, 2020

This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@gauravchaudhari02
Copy link
Contributor

@shailesh-vaidya Which better action you are talking for upload a release. Could you give a reference here?

@gauravchaudhari02
Copy link
Contributor

@shailesh-vaidya Working Generic Workflow for RPM build. Please have a look

jobs:
  build:
    runs-on: ubuntu-latest
    env:
       GITHUB_TOKEN: ${{secrets.ACCESS_TOKEN}}
       TAG: 7.7.1908
    steps:
    - name: Checkout ${{ github.event.repository.name }}
      uses: actions/checkout@v2
      with: 
        token: ${{ env.GITHUB_TOKEN }} 
        submodules: 'recursive'
    - name: GitHub registry login
      run: docker login docker.pkg.github.com -u ${{ github.actor }} -p ${{ env.GITHUB_TOKEN }}
    - name: Build ${{ github.event.repository.name }} RPM
      run: |
        docker run -i -e build_number=${GITHUB_RUN_NUMBER} -v $GITHUB_WORKSPACE:/workspace -w /workspace docker.pkg.github.com/${{ github.repository }}/${{ github.event.repository.name }}:${{ env.TAG }} 'sh <Path to RPM building shell script>'
    - name: Create ${{ github.event.repository.name }} release
      uses: softprops/action-gh-release@v1
      with:
       tag_name: "1.0.0-${{ github.run_number }}"
       files: '${{ github.event.repository.name }}*.rpm'
      env:
       GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

@shailesh-vaidya
Copy link
Contributor Author

@gauravchaudhari02 Workflow looks good to me.
@mukul-seagate11 Lets follow above workflow for all the components . Let me know if any review comments.

@mukul-seagate11 mukul-seagate11 self-assigned this Aug 25, 2020
@mukul-seagate11
Copy link
Contributor

@shailesh-vaidya, looks good
Just one point here as base image will always be ubuntu-latest or there are other images available too

@hessio
Copy link

hessio commented Jan 5, 2022

@shailesh-vaidya can you provide an update on this issue?

@hessio hessio added Status: Fix Scheduled Will be fixed in an upcoming release or sooner Status: L1 Triage Initial triage Triage: DevAd Triage owner is a developer advocate labels Jan 5, 2022
@shailesh-vaidya
Copy link
Contributor Author

Hi @hessio - We can close this issue for now. This was created as part of one of the tasks to track Jenkins -> GitHub Actions migration.

@hessio
Copy link

hessio commented Jan 7, 2022

ok thanks :)

@hessio hessio closed this as completed Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
github actions GitHub Action related changes improvement Improvement in current workflow. Status: Fix Scheduled Will be fixed in an upcoming release or sooner Status: L1 Triage Initial triage Triage: DevAd Triage owner is a developer advocate
Projects
None yet
Development

No branches or pull requests

4 participants