diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml new file mode 100644 index 0000000..18b668e --- /dev/null +++ b/.forgejo/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Build and Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: docker + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.24' + - name: Install Goreleaser + run: | + curl -sL https://git.io/goreleaser | bash + - name: Run Goreleaser + env: + GORELEASER_CURRENT_TAG: ${{ github.ref_name }} + FORGEJO_USERNAME: ${{ secrets.FORGEJO_PACKAGE_PUBLISH_USERNAME }} + FORGEJO_TOKEN: ${{ secrets.FORGEJO_PACKAGE_PUBLISH_TOKEN }} + run: | + ./bin/goreleaser release --clean --skip-validate \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..15b0068 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,25 @@ +project_name: send2gokapi + +builds: + - main: . + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + +archives: + - format: zip + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + +release: + disable: true # We won't create GitHub/Gitea releases directly + +blobs: + - provider: generic + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.tar.gz" + path: dist/* + url_template: https://lmika.dev/api/packages/cmd/generic/{{ .ProjectName }}/{{ .Version }}/{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.tar.gz + username: "${FORGEJO_USERNAME}" + password: "${FORGEJO_TOKEN}" \ No newline at end of file