Juno Latest Build #117
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: Juno Latest Build | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: juno-admin-dev | |
| MYSQL_IMAGE_NAME: mysql-dev | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: "14" | |
| cache: "yarn" | |
| cache-dependency-path: assets/package-lock.json | |
| - name: yarn build dist | |
| run: | | |
| cd assets | |
| yarn install | |
| yarn build | |
| git checkout -- yarn.lock | |
| - name: Set up Go 1.19 | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.19 | |
| - uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| - name: Get dependencies | |
| run: | | |
| go env | |
| go get -v -t -d ./... | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v4 | |
| with: | |
| # either 'goreleaser' (default) or 'goreleaser-pro' | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean --snapshot | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: image_name | |
| run: echo ${{ env.IMAGE_NAME }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v4.6.0 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set outputs | |
| id: vars | |
| run: | | |
| echo "::set-output name=file_name::$(ls dist/juno_*linux* |cut -c 6-)" | |
| - name: Build and push Docker image | |
| uses: mr-smithers-excellent/docker-build-push@v6.2 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| image: ${{ env.IMAGE_NAME }} | |
| buildArgs: "JUNO_TAR=${{ steps.vars.outputs.file_name }}" | |
| addLatest: true | |
| directory: dist | |
| dockerfile: ./cmd/juno-admin/Dockerfile | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push MySQL image | |
| uses: mr-smithers-excellent/docker-build-push@v6.2 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| image: ${{ env.MYSQL_IMAGE_NAME }} | |
| addLatest: true | |
| directory: deployment/dockerfiles/mysql | |
| dockerfile: deployment/dockerfiles/mysql/Dockerfile | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate install.yml | |
| run: | | |
| make gen-dev-deployment | |
| # Ignore the error when we delete the latest release, it might not exist. | |
| - name: Delete the latest Release | |
| continue-on-error: true | |
| run: | | |
| gh release delete latest --repo $GITHUB_REPOSITORY | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }} | |
| # Ignore the error when we delete the latest tag, it might not exist. | |
| - name: Delete the latest Tag | |
| continue-on-error: true | |
| run: | |
| gh api --method DELETE /repos/$GITHUB_REPOSITORY/git/refs/tags/latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }} | |
| - name: Recreate the latest Release and Tag | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: false | |
| prerelease: true | |
| tag_name: latest | |
| files: | | |
| ./dist/juno_0.0.0-SNAPSHOT-* | |
| ./deployment/install.yml | |
| ./deployment/install-mirror.yml | |
| body: | | |
| This is the "latest" release of **Juno**, which contains the most recent commits from the main branch. | |
| This release **might not be stable**. | |
| It is only intended for developers wishing to try out the latest features in Juno, some of which may not be fully implemented. |