Skip to content

Commit

Permalink
Test tags
Browse files Browse the repository at this point in the history
  • Loading branch information
NehaNaithani committed Jan 31, 2024
1 parent 62c93c2 commit b299127
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 13 deletions.
89 changes: 77 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,22 @@ jobs:
if: always()
run: sudo bash test/deploy_ecn.bash deleteECN

Publish:
Publish_dev:
runs-on: ubuntu-20.04
needs: [Build]
needs: [Build, Integration]
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
name: Publish
outputs:
version: ${{ steps.step1.outputs.pkg_version }}
name: Publish_dev
steps:
- name: Test
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
echo "I am the tag"
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down Expand Up @@ -128,15 +135,15 @@ jobs:
dockerfile: Dockerfile

- name: Login to Github Container Registry
if: (github.ref == 'refs/heads/develop') || contains(github.ref_name, '^v.*')
if: ${{ github.ref_name == 'develop' && || startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v2
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build and Push to ghcr
if: (github.ref == 'refs/heads/develop') || contains(github.ref_name, '^v.*')
if: ${{ github.ref_name == 'develop' && || startsWith(github.ref, 'refs/tags/v') }}
uses: docker/build-push-action@v3
id: build_push_ghcr
with:
Expand Down Expand Up @@ -233,8 +240,71 @@ jobs:
PACKAGECLOUD-DISTRIB: rpm_any/rpm_any
PACKAGECLOUD-TOKEN: ${{ secrets.packagecloud_token }}

- name: Upload Agent Artifact
uses: actions/upload-artifact@v3
with:
name: agent
path: packaging/**/*

Publish_prod:
runs-on: ubuntu-20.04
needs: [ Build, Integration, Publish_dev ]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
name: Publish
steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: 'Get Previous tag'
# id: previoustag
# uses: "WyriHaximus/github-action-get-previous-tag@v1"
# with:
# fallback: 0.0.0
#
# - name: Set up Ruby 3.1.4
# uses: actions/setup-ruby@v1
# with:
# ruby-version: 3.1.4
# - run: |
# gem install --no-document fpm
# fpm -h
# - name: Install package_Cloud
# run: |
# gem install package_cloud
# package_cloud -h
# - name: get gradle version
# shell: bash
# id: version
# run: echo "version=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')" >> "${GITHUB_OUTPUT}"
# - name: get package version
# shell: bash
# id: pkg_version
# run: |
# if [[ ${{ github.ref_name }} =~ ^v.* ]] ; then
# echo "version=${{ steps.version.outputs.version }}" >> "${GITHUB_OUTPUT}"
# else
# echo "version=${{ steps.version.outputs.version }}-${{ github.run_number }}" >> "${GITHUB_OUTPUT}"
# fi
- run: echo ${{needs.Publish_dev.outputs.version}}
- name : Test
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
echo "I am in the tag"
- uses: actions/download-artifact@v2
with:
name: deb-package

- uses: actions/download-artifact@v2
with:
name: rpm-package

- name: Publish tagged deb package to packagecloud
if: contains(github.ref_name, '^v.*')
if: startsWith(github.ref, 'refs/tags/v')
uses: danielmundi/upload-packagecloud@v1
with:
PACKAGE-NAME: iofog-agent_${{ steps.pkg_version.outputs.version }}_all.deb
Expand All @@ -244,7 +314,7 @@ jobs:
PACKAGECLOUD-TOKEN: ${{ secrets.packagecloud_token }}

- name: Publish tagged rpm package to packagecloud
if: contains(github.ref_name, '^v.*')
if: startsWith(github.ref, 'refs/tags/v')
uses: danielmundi/upload-packagecloud@v1
with:
PACKAGE-NAME: packaging/iofog-agent/iofog-agent-${{ steps.sub.outputs.result }}-1.noarch.rpm
Expand All @@ -253,11 +323,6 @@ jobs:
PACKAGECLOUD-DISTRIB: rpm_any/rpm_any
PACKAGECLOUD-TOKEN: ${{ secrets.packagecloud_token }}

- name: Upload Agent Artifact
uses: actions/upload-artifact@v3
with:
name: agent
path: packaging/**/*



2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

allprojects {
group = 'org.eclipse'
version = '3.1.0'
version = '3.0.3'
}

subprojects {
Expand Down

0 comments on commit b299127

Please sign in to comment.