From 905134c097fd2c7e3dcd59c7a38baa6e7d18d611 Mon Sep 17 00:00:00 2001 From: iberdinsky Date: Fri, 10 May 2024 11:17:35 +0200 Subject: [PATCH] Actions --- .github/workflows/release.yaml | 64 ++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 55 ----------------------------- 2 files changed, 64 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/release.yaml delete mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3575f3b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,64 @@ +name: Create Archive on Tag + +on: + push: + tags: + - '*' + +jobs: + build_and_archive: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js 21 + uses: actions/setup-node@v4 + with: + node-version: '21' + + - name: Enable Corepack + working-directory: client + run: corepack enable + + - name: Install dependencies + working-directory: client + run: yarn install + + - name: Build project + working-directory: client + run: yarn build + + - name: Create archives of dist folder + working-directory: client + run: | + zip -r dist.zip dist + tar -czvf dist.tar.gz dist + + - name: Upload archives as artifacts + uses: actions/upload-artifact@v4 + with: + name: dist.zip + path: client/dist.zip + + - name: Upload tar.gz as artifact + uses: actions/upload-artifact@v4 + with: + name: dist.tar.gz + path: client/dist.tar.gz + + - name: Create GitHub release + uses: elgohr/Github-Release-Action@v5 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + title: ${{ github.ref_name }} + + - name: Upload dist.zip and dist.tar.gz to the release + uses: svenstaro/upload-release-action@v2 + with: + file: client/dist.* + file_glob: true + tag: ${{ github.ref_name }} + repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml deleted file mode 100644 index 5de83ef..0000000 --- a/.goreleaser.yaml +++ /dev/null @@ -1,55 +0,0 @@ -project_name: launchr-web - -version: 1 - -before: - hooks: - - go mod download - - go test ./... - -builds: - - main: ./cmd/launchr - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm64 - tags: - - embed - flags: - - -trimpath - ldflags: - - -s -w - - -X '{{.ModulePath}}.name={{.Binary}}' - - -X '{{.ModulePath}}.version={{.Version}}' - -archives: - - format: binary - # this name template makes the OS and Arch compatible with the results of uname. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Branch }}-{{.ShortCommit}}" -report_sizes: true -changelog: - sort: asc - filters: - exclude: - - "^test:" - - "^chore" - - "merge conflict" - - Merge pull request - - Merge remote-tracking branch - - Merge branch - - go mod tidy \ No newline at end of file