|
5 | 5 | - 'v*' |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - docker-images: |
9 | | - name: Publish docker images |
| 8 | + goreleaser: |
10 | 9 | runs-on: ubuntu-latest |
11 | 10 | steps: |
12 | | - - id: get-tag |
13 | | - run: | |
14 | | - tag=$(echo "${{github.ref}}" | sed 's/^refs\/tags\/v//') |
15 | | - echo "::set-output name=tag::$tag" |
16 | 11 | - name: Checkout |
17 | | - uses: actions/checkout@v2 |
18 | | - - name: Set up QEMU |
19 | | - uses: docker/setup-qemu-action@v1 |
20 | | - - name: Set up Docker Buildx |
21 | | - uses: docker/setup-buildx-action@v1 |
22 | | - - name: Login to DockerHub |
23 | | - uses: docker/login-action@v1 |
| 12 | + uses: actions/checkout@v3 |
| 13 | + - name: Setup Go |
| 14 | + uses: actions/setup-go@v3 |
24 | 15 | with: |
25 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
26 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
27 | | - - name: Build and push |
28 | | - uses: docker/build-push-action@v2 |
| 16 | + go-version: 1.18.3 |
| 17 | + - name: Run GoReleaser |
| 18 | + uses: goreleaser/goreleaser-action@v2 |
29 | 19 | with: |
30 | | - context: ./server |
31 | | - file: ./server/Dockerfile # file is not relative to context https://github.com/docker/build-push-action/issues/51#issuecomment-702506036 |
32 | | - platforms: linux/amd64,linux/arm64 |
33 | | - push: true |
34 | | - tags: saiya/dsps:${{ steps.get-tag.outputs.tag }} |
35 | | - build-args: | |
36 | | - DSPS_VERSION_ID=${{ steps.get-tag.outputs.tag }} |
37 | | -
|
38 | | - js-client-npm-release: |
39 | | - name: Publish JS client |
40 | | - runs-on: ubuntu-latest |
41 | | - steps: |
42 | | - - id: get-version |
43 | | - run: | |
44 | | - version=$(echo "${{github.ref}}" | sed 's/^refs\/tags\/v//') |
45 | | - echo "::set-output name=version::$version" |
46 | | - - name: Checkout |
47 | | - uses: actions/checkout@v2 |
48 | | - - uses: actions/setup-node@v1 |
49 | | - with: |
50 | | - node-version: '12.x' |
51 | | - registry-url: 'https://registry.npmjs.org' |
52 | | - scope: '@dsps' |
53 | | - - name: Yarn publish |
54 | | - run: | |
55 | | - yarn install --frozen-lockfile |
56 | | - yarn publish --frozen-lockfile --non-interactive --new-version ${{ steps.get-version.outputs.version }} --no-git-tag-version |
57 | | - working-directory: client/js |
58 | | - env: |
59 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
60 | | - |
61 | | - github-release: |
62 | | - name: Create GitHub release |
63 | | - runs-on: ubuntu-latest |
64 | | - steps: |
65 | | - - id: get-tag |
66 | | - run: | |
67 | | - tag=$(echo "${{github.ref}}" | sed 's/^refs\/tags\/v//') |
68 | | - echo "::set-output name=tag::$tag" |
69 | | - - uses: actions/checkout@v2 |
70 | | - - uses: actions/setup-go@v2 |
71 | | - with: |
72 | | - go-version: '1.18.3' |
73 | | - - name: Build |
74 | | - run: | |
75 | | - go install |
76 | | - make build |
77 | | - working-directory: server |
78 | | - env: |
79 | | - DSPS_VERSION_ID: ${{ steps.get-tag.outputs.tag }} |
80 | | - |
81 | | - # https://zenn.dev/seita/articles/d1dba77043be8fd50eeb |
82 | | - - name: Get the version |
83 | | - id: get_version |
84 | | - run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} |
85 | | - - name: Get commit summary |
86 | | - id: get_commit_summary |
87 | | - run: | |
88 | | - PREVIOUS_TAG=$(git tag --sort=-creatordate | sed -n 2p) |
89 | | - echo "PREVIOUS_TAG: $PREVIOUS_TAG" |
90 | | - COMMIT_SUMMARY="$(git log --oneline --pretty=tformat:"%h %s" $PREVIOUS_TAG..${{ github.ref }})" |
91 | | - COMMIT_SUMMARY="${COMMIT_SUMMARY//$'\n'/'%0A'}" |
92 | | - echo ::set-output name=COMMIT_SUMMARY::$COMMIT_SUMMARY |
93 | | -
|
94 | | - - id: create_release |
95 | | - uses: actions/create-release@v1 |
| 20 | + version: latest |
| 21 | + workdir: server |
| 22 | + args: release --rm-dist |
96 | 23 | env: |
97 | 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
98 | | - with: |
99 | | - tag_name: ${{ github.ref }} |
100 | | - release_name: Release ${{ github.ref }} |
101 | | - body: ${{ steps.get_commit_summary.outputs.COMMIT_SUMMARY }} |
102 | | - draft: true |
103 | | - prerelease: true |
104 | | - - uses: actions/upload-release-asset@v1 |
105 | | - env: |
106 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
107 | | - with: |
108 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
109 | | - asset_path: ./server/dsps.zip |
110 | | - asset_name: dsps.zip |
111 | | - asset_content_type: application/zip |
| 25 | + |
| 26 | + # js-client-npm-release: |
| 27 | + # name: Publish JS client |
| 28 | + # runs-on: ubuntu-latest |
| 29 | + # steps: |
| 30 | + # - id: get-version |
| 31 | + # run: | |
| 32 | + # version=$(echo "${{github.ref}}" | sed 's/^refs\/tags\/v//') |
| 33 | + # echo "::set-output name=version::$version" |
| 34 | + # - name: Checkout |
| 35 | + # uses: actions/checkout@v2 |
| 36 | + # - uses: actions/setup-node@v1 |
| 37 | + # with: |
| 38 | + # node-version: '12.x' |
| 39 | + # registry-url: 'https://registry.npmjs.org' |
| 40 | + # scope: '@dsps' |
| 41 | + # - name: Yarn publish |
| 42 | + # run: | |
| 43 | + # yarn install --frozen-lockfile |
| 44 | + # yarn publish --frozen-lockfile --non-interactive --new-version ${{ steps.get-version.outputs.version }} --no-git-tag-version |
| 45 | + # working-directory: client/js |
| 46 | + # env: |
| 47 | + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments