Skip to content

Commit

Permalink
add tag
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust committed Nov 28, 2023
1 parent a4314f2 commit 74cf71e
Showing 1 changed file with 36 additions and 44 deletions.
80 changes: 36 additions & 44 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,46 @@ name: GitHub Actions ES Publish
run-name: ${{ github.actor }} is publishing a release 🚀
on:
push:
# tags:
# - 'v*'
branches: ['build'] # TODO: remove
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
# TODO: uncomment
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: '1.20'
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

# - name: Build
# run: |
# make TARGETOS=linux TARGETARCH=amd64
# mv cmd/es-node/es-node es-node.${{github.ref_name}}.linux-amd64
# make TARGETOS=darwin TARGETARCH=amd64
# mv cmd/es-node/es-node es-node.${{github.ref_name}}.darwin-amd64
# make TARGETOS=darwin TARGETARCH=arm64
# mv cmd/es-node/es-node es-node.${{github.ref_name}}.darwin-arm64
# make TARGETOS=windows TARGETARCH=amd64
# mv cmd/es-node/es-node es-node.${{github.ref_name}}.windows-amd64
- name: Build
run: |
make TARGETOS=linux TARGETARCH=amd64
mv cmd/es-node/es-node es-node.${{github.ref_name}}.linux-amd64
make TARGETOS=darwin TARGETARCH=amd64
mv cmd/es-node/es-node es-node.${{github.ref_name}}.darwin-amd64
make TARGETOS=darwin TARGETARCH=arm64
mv cmd/es-node/es-node es-node.${{github.ref_name}}.darwin-arm64
make TARGETOS=windows TARGETARCH=amd64
mv cmd/es-node/es-node es-node.${{github.ref_name}}.windows-amd64
# - name: Create Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ github.ref }}
# name: Release ${{github.ref_name}}
# files: |
# es-node.${{github.ref_name}}.linux-amd64
# es-node.${{github.ref_name}}.darwin-amd64
# es-node.${{github.ref_name}}.darwin-arm64
# es-node.${{github.ref_name}}.windows-amd64
# generate_release_notes: true
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
name: Release ${{github.ref_name}}
files: |
es-node.${{github.ref_name}}.linux-amd64
es-node.${{github.ref_name}}.darwin-amd64
es-node.${{github.ref_name}}.darwin-arm64
es-node.${{github.ref_name}}.windows-amd64
generate_release_notes: true

build-and-push-image:
runs-on: ubuntu-latest
Expand All @@ -55,13 +53,6 @@ jobs:
packages: write
#
steps:
# TODO remove
# - name: delete package
# uses: actions/delete-package-versions@v4
# with:
# package-name: 'es-node'
# package-type: 'container'

- name: Checkout repository
uses: actions/checkout@v4

Expand All @@ -73,7 +64,6 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
visibility: public

# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image.
# The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
Expand All @@ -93,5 +83,7 @@ jobs:
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ steps.meta.outputs.tags }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

0 comments on commit 74cf71e

Please sign in to comment.