|
| 1 | +name: cd |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | +jobs: |
| 7 | + cd: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + - uses: google-github-actions/[email protected] |
| 12 | + id: release |
| 13 | + with: |
| 14 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 15 | + release-type: simple |
| 16 | + package-name: stargazer-vanity |
| 17 | + - name: Retrieve latest tag |
| 18 | + run: echo "TAG=$(cat version.txt)" >> $GITHUB_ENV |
| 19 | + - uses: actions/setup-go@v2 |
| 20 | + with: |
| 21 | + go-version: '1.15' |
| 22 | + - uses: actions/cache@v2 |
| 23 | + with: |
| 24 | + path: ~/go/pkg/mod |
| 25 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 26 | + restore-keys: ${{ runner.os }}-go- |
| 27 | + - name: Build release assets |
| 28 | + run: make dist |
| 29 | + - name: Upload Windows asset |
| 30 | + if: ${{ steps.release.outputs.release_created }} |
| 31 | + uses: actions/upload-release-asset@v1 |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + with: |
| 35 | + upload_url: ${{ steps.release.outputs.upload_url }} |
| 36 | + asset_path: ./svg.exe |
| 37 | + asset_name: svg-windows-amd64.exe |
| 38 | + asset_content_type: application/octet-stream |
| 39 | + - name: Upload Linux asset |
| 40 | + if: ${{ steps.release.outputs.release_created }} |
| 41 | + uses: actions/upload-release-asset@v1 |
| 42 | + env: |
| 43 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + with: |
| 45 | + upload_url: ${{ steps.release.outputs.upload_url }} |
| 46 | + asset_path: ./svg.linux |
| 47 | + asset_name: svg-linux-amd64 |
| 48 | + asset_content_type: application/octet-stream |
| 49 | + - name: Upload macOS asset |
| 50 | + if: ${{ steps.release.outputs.release_created }} |
| 51 | + uses: actions/upload-release-asset@v1 |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + with: |
| 55 | + upload_url: ${{ steps.release.outputs.upload_url }} |
| 56 | + asset_path: ./svg.darwin |
| 57 | + asset_name: svg-darwin-amd64 |
| 58 | + asset_content_type: application/octet-stream |
0 commit comments