Move latest release tag automagically
@@ -197,10 +197,35 @@ jobs:
runs-on: ubuntu-latest
steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: '0'
+
- uses: actions/download-artifact@v2
with:
path: artifacts/
+ - name: Advance tag
+ uses: actions/github-script@v3
+ with:
+ github-token: ${{secrets.GITHUB_TOKEN}}
+ script: |
+ try {
+ await github.git.deleteRef({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ ref: "tags/latest"
+ })
+ } catch (e) {
+ console.log("The latest tag doesn't exist yet: " + e)
+ }
+ await github.git.createRef({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ ref: "refs/tags/latest",
+ sha: context.sha
+ })
+
- name: Extract ubuntu releases
run: |
mkdir upload
