Update release script to check only tracked files for secrets #1
Workflow file for this run
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: release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Gitleaks scan | |
| uses: gitleaks/gitleaks-action@v2 | |
| with: | |
| config-path: .gitleaks.toml | |
| - name: Build autoar-web | |
| working-directory: autoar-web | |
| run: | | |
| go mod tidy | |
| GOOS=linux GOARCH=amd64 go build -o build/autoar-web-linux-amd64 ./cmd/server | |
| GOOS=linux GOARCH=arm64 go build -o build/autoar-web-linux-arm64 ./cmd/server | |
| GOOS=darwin GOARCH=amd64 go build -o build/autoar-web-darwin-amd64 ./cmd/server | |
| GOOS=darwin GOARCH=arm64 go build -o build/autoar-web-darwin-arm64 ./cmd/server | |
| GOOS=windows GOARCH=amd64 go build -o build/autoar-web-windows-amd64.exe ./cmd/server | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| autoar-web/build/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: autoar-web/Dockerfile | |
| push: true | |
| tags: ghcr.io/${{ github.repository_owner }}/autoar-web:${{ github.ref_name }} | |