Merge pull request #38 from Datasance/release/1.6.x #269
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: [v*] | |
| paths-ignore: | |
| - README.md | |
| - CHANGELOG.md | |
| - LICENSE | |
| pull_request: | |
| # Sequence of patterns matched against refs/heads | |
| branches: | |
| - main | |
| paths-ignore: | |
| - README.md | |
| - CHANGELOG.md | |
| - LICENSE | |
| env: | |
| PROJECT: 'datasance' | |
| controller_image: 'ghcr.io/datasance/controller:latest' | |
| agent_image: 'ghcr.io/datasance/agent:latest' | |
| operator_image: 'ghcr.io/datasance/operator:latest' | |
| port_manager_image: 'ghcr.io/datasance/port-manager:latest' | |
| router_image: 'ghcr.io/datasance/router:latest' | |
| router_arm_image: 'ghcr.io/datasance/router:latest' | |
| # proxy_image: 'ghcr.io/datasance/proxy:latest' | |
| # proxy_arm_image: 'ghcr.io/datasance/proxy:latest' | |
| iofog_agent_version: '3.5.0' | |
| controller_version: '3.5.0' | |
| version: | |
| agent_vm_list: | |
| controller_vm: | |
| jobs: | |
| Build: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| packages: 'write' | |
| name: Build | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # - name: Install system dependencies | |
| # run: | | |
| # sudo apt-get update | |
| # sudo apt-get install -y libgpgme-dev | |
| - name: Install ARM cross-compilation toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| cache: false | |
| - run: go version | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v3 | |
| with: | |
| version: v1.64.4 | |
| args: --timeout=5m0s | |
| working-directory: . | |
| - name: Run bootstrap | |
| run: PIPELINE=1 script/bootstrap.sh | |
| - name: 'Get Previous tag' | |
| id: previoustag | |
| uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
| with: | |
| fallback: v0.0.0 | |
| - name: Set image tag | |
| shell: bash | |
| id: tags | |
| run: | | |
| if [[ ${{ github.ref_name }} =~ ^v.* ]] ; then | |
| echo "VERSION=${{ github.ref_name }}" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "VERSION=${{ steps.previoustag.outputs.tag }}-dev" >> "${GITHUB_OUTPUT}" | |
| fi | |
| - name: Get image tag | |
| run: | | |
| echo ${{ steps.tags.outputs.VERSION }} | |
| - name: potctl build packages GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: --snapshot --clean --verbose --config ./.goreleaser-potctl.yml | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: potctl | |
| path: ${{ github.workspace }}/dist | |
| Publish_potctl_Prod: | |
| needs: [Build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| checks: write | |
| contents: write | |
| deployments: write | |
| id-token: write | |
| issues: write | |
| discussions: write | |
| packages: write | |
| pages: write | |
| pull-requests: write | |
| repository-projects: write | |
| security-events: write | |
| statuses: write | |
| name: Publish potctl Prod | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # - name: Install system dependencies | |
| # run: | | |
| # sudo apt-get update | |
| # sudo apt-get install -y libgpgme-dev | |
| - name: Install ARM cross-compilation toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23.0' | |
| cache: false | |
| - name: Get image tag | |
| run: | | |
| echo ${{ needs.Build.outputs.VERSION }} | |
| - name: potctl build packages GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: --clean --verbose --config ./.goreleaser-potctl.yml | |
| env: | |
| VERSION: ${{ needs.Build.outputs.VERSION }} | |
| GITHUB_TOKEN: ${{ secrets.PAT }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: potctl | |
| path: ${{ github.workspace }}/dist | |
| overwrite: true |